RSA Tools

The following are tools to perform an RSA encryption.

How to convert letters to numbers and numbers to letters (because RSA works on messages that are numbers).

We will do something fairly naive.

  1. Look at the public key n; choose a word that’s short enough so the following process will produce a number less than n.
  2. Put your word into the Boxentrique Letter to Number Converter to get it in ASCII (choose ASCII in Code Type, and don’t use spaces or carriage returns or punctuation; it will pick that all up).  The result is a series of 3-digit numbers (if you get a 2-digit number, pad it with a zero, so A is 97, so make it 097).
  3. Concatenate the numbers to use as your message m (ignoring leading zeroes).
  4. For example, AM becomes 97109 and MA becomes 109097.

To undo, use the same process backward, using the Number to Letter Converter.

Finding primes

Euler Phi Function

Modular inversion

Modular exponentiation