算法还原:
a =raw_input('enter the string: \n')num =len(a)All_c=0for i in range(0,num,1): b =ord(a[i]) All_c+=bprint All_c#print hex(All_c)result = All_c -int('35',16)*10print resultprint hex(result)if result==74: print 'OK'else: print('error')
注册机:
#-*-coding=gbk-*-import randomgetstring=raw_input('输入1获取序列号:')x ='L1234567890-=QWERTYUIOP[]\ASDFGHJKL;\'ZXCVBNM,./!@#$%^&*()_+qwertyuiop{}|asdfghjkl:"zxcvbnm<>?'x_len=len(x)while(getstring=="1"): for i in range(0,x_len,1): a1 = x[random.randint (0,len(x)-1)] for i in range(0,x_len,1): a2 = x[random.randint (0,len(x)-1)] a3 = x[random.randint (0,len(x)-1)] a4 = x[random.randint (0,len(x)-1)] a5 = x[random.randint (0,len(x)-1)] a6 = x[random.randint (0,len(x)-1)] a7 = x[random.randint (0,len(x)-1)] a8 = x[random.randint (0,len(x)-1)] a9 = x[random.randint (0,len(x)-1)] a10 = x[random.randint (0,len(x)-1)] #print x_len #print a1,a2,a3,a4,a5,a6,a7,a8,a9,a10 #print ord(str(a1)),ord(str(a2)),ord(str(a3)),ord(str(a4)),ord(str(a5)),ord(str(a6)),ord(str(a7)),ord(str(a8)),ord(str(a9)),ord(str(a10)), m = ord(str(a1))+ord(str(a2))+ord(str(a3))+ord(str(a4))+ord(str(a5))+ord(str(a6))+ord(str(a7))+ord(str(a8))+ord(str(a9))+ord(str(a10))-int('35',16)*10 if m==74: print 'The SN is: '+a1+a2+a3+a4+a5+a6+a7+a8+a9+a10 #print 'get!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' key2=raw_input('make sn:') #else: #print 'error'+str(i) #print 'end'else: print '输入1'