RosettaCodeData/Task/RSA-code/Python/rsa-code-3.py

19 lines
614 B
Python

>>>
To redefine n,e, or d, type 'n','e',... etc.
To encrypt a message with the current key, type 'Encrypt'
To decrypt a message with the current key, type 'Decrypt'
Type quit to exit
Enter Command...ENCRYPT
Enter Plaintext :drink MORE Ovaltine
Ciphertext: [140, 2222, 1864, 1616, 821, 384, 2038, 2116, 2222, 205, 384, 2116, 45, 1, 2497, 793, 1864, 1616, 205, 41]
Number of Ciphertext blocks: 20
Enter Command...decrypt
Enter ciphertext blocks:[140, 2222, 1864, 1616, 821, 384, 2038, 2116, 2222, 205, 384, 2116, 45, 1, 2497, 793, 1864, 1616, 205, 41]
Plaintext is: drink more ovaltineu
Enter Command...quit
>>>