RSA
Encryption
Alice first generates primes p and q and N such that N=pq. This is half of the public key, with the other half being the public exponent e, which should be coprime to ϕ(N) (meaning gcd(ϕ(N),e)=1). These two values are then made public.
If Bob wants to send a message M to Alice using RSA, he calculates:
Where c is now the ciphertext and is sent to Alice.
Decryption
Alice calculates ϕ(N)=(p−1)(q−1) and then calculates the modular multiplicative inverse d of emodϕ(N). d is the private key used for the decryption which is known only to Alice.
To decrypt, the Alice calculates M again:
The proof for this is based on Euler's Formula. Because we calculated d such that de≡1modϕ(N), then we know that there is an integer k such that de=kϕ(N)+1. Also note that cd≡(Me)d≡Mde:
Attacks on RSA
Attacks on RSA generally fall into several categories, including weak public exponent or a poor choice of p,q which results in a value of N which can be factorised or attacked in another way. Remember that the trapdoor function in RSA is the difficulty of factoring N into the primes that make it up so only Alice is able to compute ϕ(N) efficiently!
Last updated
Was this helpful?