RSA stands for Rivest-Shamir-Adleman algorithm was invented on 1977 which is mostly used public-key cryptosystem. It was designed by Ron Rivest, Adi Shamir, and Leonard Adleman (Milanov 2009). This is the 1st crypto system which used two different keys to encrypt and decrypt the messages. In this cryptosystem it uses public key to encrypt and private key to decrypt the messages. Public key can be shared with everyone but the private key has to be with the person who want to decrypt the message secretly. If a messages encrypted using the public key, the message can only be decrypted using a private key show in the image below.
As shown in the image above Bob use a public key to encrypt the message which he wants …show more content…
In this algorithm generating these two keys are the hardest part. To generate keys it uses few steps, and its explained below.
• The first step is to select two largest random prime numbers and assign to p and q. As example, p = 11 and q = 7.
• Then it is need to calculate RSA modular (n). To calculate RSA modular it as to multiply p from q. As example, n = p * q
• Second step is to calculate totient function (Q (n)). It mean totient of RSA calculated by p – 1 and q – 1. As example, Q (n) = (p – 1) (q – …show more content…
As example, 1< X < Q (n).
• Final step is to calculate private decryption key (d). To calculate RSA use a formula, de = 1 mode Q (n). To solve this formula it use Euclidean algorithm. When the remainder equals to 1, RSA will start extended euclidean algorithm to solve deeper. When two original values shows up, that’s the end of the algorithm. If the last value is positive, it will assign that value to d or if it is a negative value, it has to be subtracted from totient function. As example, d = Q (n) – X.
All above mentioned steps are must to be followed when generating key in RSA.
Encryption
In RSA all the messages are encrypted using a public key. To do this public key encryption it use a formula, c = me mod n.
As an example which shown in figure 1, Bob wants to send a message saying “HIDE” to Alice. When encrypting the message, above mention formula will encrypt each and every character in the message. Example: p = 11, q = 5, n = 55, Q (n) = 40, e = 7, d = 23.
Message: HIDE
Formula: c = me mod n.
Encrypting