Cryptography
Computer Science & Statistics at University of Rhode Island
RSA The RSA algorithm presented below was first published in [6] Setup
Encryption and Decryption Suppose
Bob has a message to Alice. Regarding it, or a block of numbers in it, as
a number x in the range of 0 to M-1. Bob
calculates the ciphertext as
y = xe
mod M Now
Alice can decrypt it
x = yd
mod M Since Alice publishes e and M, any one who wants to send encrypted messages to Alice can do so, but these messages cannot be decrypted without the knowledge of d. d is kept secret and only Alice knows it, she can only decrypt messages. Example
M
= p * q = 5 * 11 = 55 N
= (p-1) * (q-1) = 4 * 10 = 40
d
= e-1 mod N = (1/7) mod 40 = 23
so
the encrypted message is 29.
4316720717749415770740818372739989
mod 55 = 24 so the decrypted message is 24, which is the initial message |