The RSA Algorithm
Understand the steps of the RSA algorithm, with an example explaining how to encrypt the message, send it over an unencrypted channel, and decrypt the message at the receiver’s end.
With that bit of number theory under our belts, we are ready to tackle the RSA algorithm. Here is how it goes. Bob wants to send me an encrypted message. The RSA algorithm has the following steps.
-
I create a large number by multiplying together two fairly large prime numbers and ; so .
-
I also create an encryption key with and check that has no common factors (other than ) with . I send the integers and to Bob. I may use an unencrypted channel to do so.
-
Let’s assume that Bob expresses his message as a number . Using the values of and I have sent him, Bob calculates another number such that and sends the number to me.
-
In the meantime, I have calculated an integer such that
which means that divides evenly, that is, with no remainder. I need the two prime numbers and to calculate .
- To decode the message from Bob, I solve .
Get hands-on with 1400+ tech skills courses.