RSA Coding Scheme

This encoding and decoding scheme is based on modular arithmetic. See the textbook for a full explanation of the method.

This activity allows you to encode three-letter messages and decode messages represented by five or six digit numbers. It uses the public keys 257 and 262831 and the private key 212897.

To encode a message, each letter is first converted into a number: A to 01, B to 02, C to 03, and so on.

For example, let RSA be the message you want to encode. R is 18, S is 19, and A is 01, so RSA is represented by the number 181901. This number is raised to the 257th power and the answer is divided by 262831. The encoded message will be the remainder of this division: 146460.

To decode a message such as 146460, raise this number to the 212897th power and divide the answer by 262831. The remainder is 181901, which becomes RSA.