RSA encryption of messages

After the RSA key generation, the modulus N and the RSA key e can be published. Anyone could encrypt a message to the owner of the secret RSA key or check a digital signature.

If you generate the RSA key by your own in the RSA demo dialog the public RSA parameter appears already in the dialog. In the other case you enter the public RSA paramater. The message can now be encrypted.

To this end, enter the "plaintext" message M that is to be encrypted. For example:

"Verkaufen Sie am 14.07.00 meine Aktienpakete, und kaufen Sie mir dafür eine Südsee Insel" [Sell my shares on 14 July 2000 and use the proceeds to buy me a South Sea Island].

When you click on Encrypt, first of all the message is converted to numbers. For this purpose, message M is split up into blocks of k characters (M = M[1] # M[2] # ... # M[j]), whereby k*8 is always smaller than the bit length of RSA modulus N. The message blocks (M[i], i = 1, 2, ..., j) are converted for encryption into numbers (m[i], for i = 1, 2, ..., j) and encrypted with the public RSA key (N,e) according to the following formula:

c[i] = m[i]^e (mod N) for i = 1, 2, ..., j .

Because the public key (N,e) is available to everyone and the secret key (N,d) remains confidential, we can establish that

Anyone can encrypt a message with the public key. But only the owner of the secret key can decrypt the message again.

rsa_demo_3.gif

The conversion of the plaintext M to numbers m = m[1] # m[2] # .... # m[j] and the encrypted version c = c[1] # c[2] # .... # c[j] are displayed in the two lines below the data input field.

The character # does not have any significance here: it is simply a visual separator between different number blocks to be encrypted or decrypted.

You can specify the block length k by clicking on Options for the alphabet and the number system. In the dialog accessed by this option you can also determine the basis for representation of numbers in RSA encryption and you can experiment with the RSA variant from the story Dialogue of the Sisters [see c‚t 25/99].

Instead of entering text you can also specify in the options that you wish to directly encrypt a sequence of plaintext numbers m = m[1] # m[2] # ... # m[j]:

rsa_demo_4.gif