Skip to content

Instantly share code, notes, and snippets.

@sdiehl
Created June 6, 2011 05:21
Show Gist options
  • Save sdiehl/1009772 to your computer and use it in GitHub Desktop.
Save sdiehl/1009772 to your computer and use it in GitHub Desktop.
rsa.py
encrypt = lambda msg: pow(int(''.join(map(lambda x: str('%.3d' % ord(x)),msg))), 65537, 5551201688147)
decrypt = lambda code: (lambda y: ''.join([chr(int(y[i:i+3])) for i in range(0, len(y), 3)]))(str(pow(code, 109182490673, 5551201688147)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment