The way the RSA scheme works using software such as Maple.
- Sassie Sally finds 2 large prime numbers from a list of primes on the web:
p = 20940089
q = 20940253- She gets n : n = 20940089*20940253 = 438490761502517.
- She gets f(n) = (20940089-1)*(20940253-1) = 438490719622176.
- She picks a random odd number beneath f(n) and checks if it is coprime with f(n) ; if not she tries another one. Chances are she will get one within three tries. She checks the number 43849087.
gcd(43849087, 438490719622176) = 1. It works so she lets e = 43849087.
- She solves for 43849087d = 1 (mod 438490719622176) :
With Maple : msolve(43849087*d = 1, 438490719622176).Maple gives d = 45051024550015.
- Sassie Sally posts the publlic key (e, n) = (43849087, 438490761502517)
- Sillie Sender Sue looks up Sassie Sally's public key since she wants to send her the message BOOK = 2151511.
Encryption : Sillie Sender Sue solves for C in 2151511e = C (mod n)215151143849087= C (mod 438490761502517 )
With Maple : msolve(2151511&^43849087 = C, 438490761502517);
Maple gives C = 371350643872343.
Sillie Sender Sue sends the encrypted message 371350643872343.
Saddam Hussein eavesdrops but is totally confused and mystified by this encrypted message since this number n = 438490761502517 is two big for him get the factors p and q by only using his little Zellers Casio calculator.
- Sassie Sally receives 37135064387234. She says "Hmmmm, what's this?"
Note : The number n still too small for Silly Sender's message to be safe, since Maple easily finds its two prime factors.
She decrypts with 371350643872343d = R (mod 438490761502517).
With Maple : msolve(371350643872343&^45051024550015 = R, 438490761502517);
Maple gives R = 2151511.
Sassie Sally transfers from digits to letters and reads the message. She says : "Oh, it's the word BOOK!"
The number n has to be several thousand digits long for it to be safe.