Update sample_ans.md

This commit is contained in:
Pavlos Papadopoulos
2022-02-18 12:41:43 +00:00
committed by GitHub
parent 015d04ac44
commit 186fd028af

View File

@@ -571,9 +571,11 @@ Signatures match: True
```python
import rsa
(bob_pub, bob_priv) = rsa.newkeys(512)
print bob_pub
print bob_priv
ciphertext = rsa.encrypt('Here is my message', bob_pub)
print (bob_pub)
print (bob_priv)
msg='Here is my message'
ciphertext = rsa.encrypt(msg.encode(), bob_pub)
message = rsa.decrypt(ciphertext, bob_priv)
print(message.decode('utf8'))
```