Details of RSA Public-Key Cryptography

June 8th, 2014 by Rossy Guide

What is this?

The RSA algorithm was publicly described in 1977 by Ron Rivest, Adi Shamir, and Leonard Adleman at MIT and the letters RSA are the initials of their surnames.

RSA is one of the public-key cryptography systems and it is widely used for secure data transmission. Public-key cryptography is also known as asymmetric-key cryptography, to distinguish it from the symmetric-key cryptography we have studied thus far. In such a cryptography system, encryption and decryption are carried out using two different keys. The two keys in such a key pair are referred to as the Public Key and the Private Key.  For the public key cryptography, all parties interested in secure communications publish their public keys.

Also, Public-key cryptography facilitates the following tasks:

o Encryption and decryption allow two communicating parties to disguise information they send to each other. The sender encrypts the information before sending it and the receiver decrypts the information after receiving it.

o Tamper detection allows the recipient of information to verify that it has not been modified in transit.

o Authentication allows the recipient of information to confirm the sender’s identity.

o Also, nonrepudiation prevents the sender of information from claiming at a later date that the information was never sent.

Tutorial for creating RSA:

RSA algorithm involves three steps: key generation, encryption and decryption. A RSA key pair consists of the following:

o The modulus n, a big integer which is equal to the product of two big prime integers, p and q.

o The public exponent e.

o The private exponent d. d is such that ed = 1 when taken modulo p-1, and also when taken modulo q-1.

o The first factor p.

o The second factor q.

o The value dp = d mod p-1.

o The value dq = d mod q-1.

o The value q’ = q-1 mod p.

The public key contains only n and e. And the private key contains all of the values specified above.

For creating a RSA key pairs, please follow the steps below.

Create RSA private & public keys:

Use OpenSSL to generate the key pairs. In the command-line tool, enter the following.

openssl genrsa -out rsakey.pem 2048         
[will generate a 2048-bit RSA private key with all the proper encoding]

                                   

In the command-line tool, enter the following.

openssl rsa -in rsakey.pem -pubout
[will print out the public key, there again with the encoding done]

 

Comments are closed.