RSA Algorithm in Cryptography


RSA is the world’s most widely used public-key cryptography method for securing communication on the internet. Cryptography involves the process of encoding information, and public-key cryptography uses pairs of keys (public and private) to share information. The mathematical properties of the RSA algorithm require that a message encrypted with a public key, which can be shared with everyone, may only be decrypted by a private key, which must be kept secret.

In 1977, three MIT faculty members- Ron Rivest, Adi Shamir and Leonard Adleman introduced the RSA algorithm that profoundly changed how we exchange digital information. Unlike older methods that required securely exchanged keys to encrypt and decrypt messages, RSA provides a method for encryption and decryption without both parties needing a shared secret key. Several mathematical concepts including trapdoor functions, totient functions and generating primes are involved in the public key encryption process.

Once two entities set up their own key pairs and share the public key with one another, the sender that has the public key of their recipient can use it to encrypt the data they want to keep secure. Once that data has been encrypted with a public key, it can only be decrypted by the private key from the same key pair. When the recipient receives the encrypted message, they use their private key to access the data.

RSA can also mark messages with a digital signature and allows originators to create messages intelligible only to intended recipients. For this reason, third parties intercepting such transmissions would find them difficult to decipher. RSA’s capabilities include functions such as encrypting internet credit card transactions, securing emails and authenticating phone calls.

 

There are two broad components when it comes to RSA cryptography, they are: 

·   Key Generation: 

    Generating the keys to be used for encrypting and decrypting the data to be exchanged.

·   Encryption/Decryption Function: 

    The steps that need to be run when scrambling and recovering the data.

Steps in RSA Algorithm

Key Generation:

You need to generate public and private keys before running the functions to generate your ciphertext and plaintext. They use certain variables and parameters, all of which are explained below:

·    Choose two large prime numbers p and q

·    Calculate n = p*q

·    Calculate  toitent function, Φ(n) = (p-1)*(q-1)

·    Choose value of  e such that 1 < e <Φ(n) and gcd(Φ(n),e)=1

·      Calculate d = e-1 mod Φ(n)

·    You can bundle private key pair as (n,d)

·    You can bundle public key pair as (n,e)


Encryption/Decryption Function:

Once you generate the keys, you pass the parameters to the functions that calculate your ciphertext and plaintext using the respective key.

·    If the plaintext is m, ciphertext = memod n.

·    If the ciphertext is c, plaintext = cdmod n

 

Advantages of RSA Algorithm over other Algorithms:

There are some advantages of the RSA Algorithm over other algorithms. Here are some of them:

      ·  RSA Algorithm is very easy to implement.

      ·  Confidential data can be transmitted safely and securely using RSA Algorithm.

      ·  RSA Algorithm involves a lot of complex mathematics which makes it more difficult to crack.

      ·  You can easily share the public key with users.



Possible Attacks on RSA Algorithm:

Here’s a list of the possible attacks on the RSA Algorithm:


     ·  Plaintext Attack: 

        

    There can be three types of Plaintext Attacks:

Short message attack: In short message attacks, it is generally assumed that the attacker already knows some of the plaintext messages. Now, if an attacker knows some blocks of plaintext, they could try to encrypt the blocks using the information. Padding bits of encryption is used to prevent a short message attack.

Cycling attack: The reverse process takes place in a cycling attack. The attacker assumes some permutations for the ciphertext. If this assumption is true, they can try and reverse the process to generate the plaintext using the ciphertext.

Unconcealed message attack :There are some rare times when, for some reason, the encrypted ciphertext is the same as the plaintext. The plaintext isn’t concealed and this type of attack is called an unconcealed message attack. 



      ·  Chosen cipher Attack:

    

     In a chosen cipher attack, the attacker finds out the plaintext from the ciphertext using the extended Euclidean algorithm.


·  Factorization Attack:

In a factorization attack, the attacker can impersonate the owners of the key. They can use the information to decrypt sensitive data bypassing the system’s security. The attackers aim at an RSA cryptographic library. This library is used to generate the RSA key. This gives the attackers access to private keys of various security tokens, Motherboard Chipsets and smartcards because they have the target’s public key.  


Difference Between AES and RSA Algorithm:


Let’s look at the differences between the AES and RES Algorithms:

Parameters

RSA

AES

Encryption

Slower

Faster

Decryption

Slower

Faster

Power Consumption

Low

High

Algorithm

Symmetric

Asymmetric

Security

Least secured

Well secured

Rounds

1

10/12/14

Hardware & Software Implementation

Not efficient

Faster

Ciphering & Deciphering Algorithm

Different

Same

Leave a Comment