This blog aims to explain the very famous encryption technique i.e. RSA, by covering every related topic like asymmetric encryption, block cipher, public key & private key.
Published in ·
--
Everyone is concerned about security today because, in this digital world, where everything is online, chances of fraud are very much high. That is why everyone is concerned about security. Most of the organizations today, provide specialist security jobs because they want the utmost security for their data.
In order to learn advanced security concepts, everyone should be familiar with basic cryptography algorithms, & RSA is one of that.
It is an encryption technique that involves 2 keys, one public & one private. In asymmetric encryption public key is available to everyone, but the private key is available to only the person/machine which has to decode the message. Since 2 keys are used in asymmetric encryption, that is why it is considered to be a stronger encryption technique as compared to symmetric encryption where only 1 public key is used for both encryption & decryption.
The cryptography algorithms which works on block cipher for encryption & decryption, they encrypt & decrypt the message in blocks, i.e. every block is encrypted separately, that is why it is hard to crack block ciphers as compared to stream ciphers.
It is developed in 1977 by Ron Rivest, Adi Shamir, & Leonard Adleman. The name RSA was coined by taking the initials of the surnames of its developers.
It is an encryption algorithm that works on a block cipher.
It is an asymmetric encryption algorithm.
It involves Euler Totient Function & Fermat’s theorem to encrypt the text. If you are not aware of these terms, please refer to my blog on each of these topics by visiting the links mentioned below.
I will explain this algorithm in 3 steps:
- Key Generation
- Encryption
- Decryption
Key Generation
In this step, 2 keys (1 public & 1 private) are generated & then they are used to encrypt & decrypt the messages respectively.
First of all, to generate the keys, we need to select 2 prime numbers, let’s say they are “p” & “q”. Now, we get a number let’s say “n” = p * q.
Furthermore, the Euler totient function has to be calculated which is:
phi(n) = (p - 1) * (q - 1)
Now, we have to select one number let’s say “k” such that, gcd(k, phi(n)) = 1, & 1 < k < phi(n).
At last, one more number let’s say “v” has to be calculated such that:
(V * k)mod(phi(n)) = 1 or (V * k) % phi(n) = 1
Now, we have calculated all the required parameters for the public & private keys. Only the key formation is left now, & that too is explained below.
Public Key: {k, n} <- It is used for encryption
Private Key: {V, n} <- It is used for decryption
Key Generation is completed now.
I hope my article explains each and everything related to the topic with all the deep concepts and explanations. Thank you so much for investing your time in reading my blog & boosting your knowledge. If you like my work, then I request you to give an applaud to this blog!