Steve M wrote: > >My goal is to combine two different numbers and > encrypt them to create a new number that cann't be traced back to the > originals. > > Here's one: > def encrypt(x, y): > """Return a number that combines x and y but cannot be traced back > to them.""" > return x + y Or you can use sha1 so you can't do basic checks to find out. :) It seems to me like he's trying to do some DH like thing, so yea, he might rather a hash **** UNTESTED **** import sha1 def encrypt(x,y): ''' Return a number that combines x and y but cannot be traced back to them. Number returned is in xrange(2**24). ''' def _dosha(v): return sha1.new(str(v)).hexdigest() return int(_dosha(_dosha(x)+_dosha(y))[5:11],16)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4