mirror of
https://github.com/billbuchanan/appliedcrypto.git
synced 2026-02-21 11:18:02 +00:00
Update sample_ans.md
This commit is contained in:
committed by
GitHub
parent
015d04ac44
commit
186fd028af
@@ -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'))
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user