Skip to content

Instantly share code, notes, and snippets.

@sheilambadi
Created February 15, 2020 13:28
Show Gist options
  • Save sheilambadi/b3b24bcd71f83060320e0bb547e3e6d1 to your computer and use it in GitHub Desktop.
Save sheilambadi/b3b24bcd71f83060320e0bb547e3e6d1 to your computer and use it in GitHub Desktop.
Calculate the decryption key and generate an encrypted message using the public key for RSA algorithm.
print('Compute d')
x = filter(lambda x: x*3 % 160 == 1, range(1,1000))
for i in x:
print(i)
print('\nEncryption')
enc_msg = pow(5,3) % 187
print(enc_msg)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment