RSA encryption example
(another Prime Pages' Glossary entries)
The Prime Glossary
Glossary: Prime Pages: Top 5000:

Suppose we pick the primes p=3457631 and q=4563413. (In practice we might pick integers 100 or more digits each, numbers which are strong probable primes for several bases.) Suppose we also choose the exponent e=1231239. We now publish the key (n, e) = (15778598254603, 1231239).

To encrypt the message "George has green hair" we convert it to an integer. Using the system suggested above this is

0705151807052 7080119270718 0505142718010 918.
For each of the four blocks (whose length was chosen so the blocks would represent integers no larger than n) we compute Be (mod n) (using the binary exponentiation). This gives the encrypted message:
1658228449402 5333403068473 7979527536648 13889903320423.
This message can be decrypted by raising each block to the 1315443185039th power modulo n.

See Also: RSA


Chris K. Caldwell © 1999-2017 (all rights reserved)