RSA
The setting is that Alice wants to send a message to Bob while making sure that the message cannot be read by an eavesdropper (Eve).
Let and be two large primes and . Moreover, take to be a number such that . We write (recall that such an inverse exists). The values of and are made public by Bob (i.e., anyone who wants to send a message to him can use these values to encrypt the message). The rest of the numbers are private and known only to Bob.
-
Encryption: Alice sends message to Bob by computing the value .
-
Decryption: Upon receiving the message , Bob computes .
The correctness of this protocol relies on a simple fact in number theory. The next subsection takes a small detour to cover that fact.
We remark that RSA is not provably secure. Indeed, it seems that the only way for Eve to recover the message is trying all numbers from to (which is infeasible when is, e.g., 512 bits long). Let us try to understand this more systematically. One potential attempt by Eve might be to factor into , which would allow her to construct . But factoring is also believed to be computationally hard, and this is a standard assumption in computation.
More precisely, the security of RSA depends on the following assumption:
Given and , no efficient algorithm can determine .