RSA encryption explained using the example

instagram viewer

Encryption systems are used to send messages in a secure way. However, there are various options here. A good example is RSA encryption, but it needs to be explained first.

Encryption systems are often difficult to understand.
Encryption systems are often difficult to understand.

Basics of RSA encryption

  • RSA encryption is a system used to encode messages. This is named after the authors, Rivest, Shamir and Adleman.
  • The basis of every coding is that a message - figuratively speaking - is provided with a lock. If you want to make this message legible, you need the right key for the respective lock.
  • There are now two terms in RSA encryption: the private and the public key. The private key is the secret key and the public key is a public key.
  • The purpose here is that a recipient can decrypt a message encrypted with a public key with his private key. In contrast, a message encrypted by a sender with a private key can only be opened with the associated public key. This two-key system is an asymmetrical procedure.
  • So-called one-way functions are required so that RSA encryption works and a key can be generated. These are simple calculations that are difficult to understand and undo.
  • Latin letters and numbers in the ICQ password - you have to pay attention to this

    If you use ICQ, you have probably already read that a password ...

  • The one-way function on which RSA encryption is based is the multiplication of two prime numbers p and q. These should be as large as possible and kept secret. The product N of this Counting is published as a public key.
  • In addition, there are the numbers e and d. E is added to the public key and should be relatively prime to equation (p-1) * (q-1). In the meantime, d is the private key, which is determined using the equation e * d = s * (p-1) * (q-1) +1. S is an arbitrary number, whereby d must be smooth at the end.
  • Now the message itself is needed. This can be encrypted with any number, whereby the ASCII code is often used. The formula C = M resultse moon N. M is the plain text and C is the encryption. Conversely, a message via M = Cd mod N decrypted.

The system explained using an example

  • The example for the RSE encryption is explained quite simply after the catchy remarks. If you now agree, for example, on the prime numbers p = 43 and q = 71, you initially get N = 3053.
  • E as a prime number to (p-1) * (q-1), i.e. 2940, would lead to e = 11. Because 2940 is not divisible by 11.
  • D now results from the equation 11 * d = s * 2940 + 1. This equation is first converted to d so that (s * 2940 + 1) / 11 = d is obtained. If you choose any number for s = 7, you get d = 1871.
  • A plain text letter, for example M, is assigned a number, for example 5. If you now know the public keys, the result is the following equation: 511 mod 3053. As an encrypted letter C, M would result in the number 1496.
  • Anyone who now has d can decrypt a message encrypted with e and N again. To decrypt 1496, d would now be required. According to the equation M = 14961871 mod 3053, M again results in the number 5.

How helpful do you find this article?

click fraud protection