Simple RSA key generation, text encryption and ciphertext decryption.
- key generation:
- input: ./rsa -g B
output: P Q N E D - text encryption:
- input: ./rsa -e E N M
output: C - ciphertext decryption:
- input: ./rsa -d D N C
output: M
B ... size of public modulus in bits
P ... randomly generated prime number
Q ... randomly generated prime number
N ... public modulus
E ... public exponent
D ... private exponent
M ... plaintext message (number, not text)
C ... ciphertext message (number, not text)