Public Key Cryptography
Public Key Cryptography
In this technique,
Sender and receiver use different keys to encrypt and decrypt the message.
It is called so because sender and receiver use different keys.
It is also called as public key cryptography.
Working-
The message exchange using public key cryptography involves the following steps-
Step-01:
At sender side,
Sender encrypts the message using receiver’s public key.
The public key of receiver is publicly available and known to everyone.
Encryption converts the message into a cipher text.
This cipher text can be decrypted only using the receiver’s private key.
Step-02:
The cipher text is sent to the receiver over the communication channel.
Step-03:
At receiver side,
Receiver decrypts the cipher text using his private key.
The private key of the receiver is known only to the receiver.
Using the public key, it is not possible for anyone to determine the receiver’s private key.
After decryption, cipher text converts back into a readable format.
Advantages-
Disadvantages-
RSA Algorithm-
Let-
Public key of the receiver = (e , n)
Private key of the receiver = (d , n)
Step-01:
At sender side,
Sender represents the message to be sent as an integer between 0 and n-1.
Sender encrypts the message using the public key of receiver.
It raises the plain text message ‘P’ to the eth power modulo n.
This converts the message into cipher text ‘C’.
C = Pe mod n
Step-02:
The cipher text ‘C’ is sent to the receiver over the communication channel.
Step-03:
At receiver side,
Receiver decrypts the cipher text using his private key.
It raises the cipher text ‘C’ to the dth power modulo n.
This converts the cipher text back into the plain text ‘P’.
P = Cd mod n
NOTE-
An individual can generate his public key and private key using the following steps-
Step-01:
Step-02:
Step-04:
Problem-01:
Given-
Prime numbers p = 13 and q = 17
Public key = 35
Step-01:
Value of n,
n=pxq
n = 13 x 17
∴ n = 221
Toilent function,
Ø(n) = (p-1) x (q-1)
Ø(n) = (13-1) x (17-1)
∴ Ø(n) = 192
Step-02:
Step-03:
Problem-02:
In the RSA public key cryptosystem, the private and public keys are (e, n) and (d, n)
respectively, where n = p x q and p and q are large primes. Besides, n is public and p and q
are private. Let M be an integer such that 0 < M < n and f(n) = (p-1)(q-1).
1. RSA Algorithm
2. Diffie-Hellman Key Exchange
RSA Algorithm-
Let-
Public key of the receiver = (e , n)
Private key of the receiver = (d , n)
Step-01:
At sender side,
Sender represents the message to be sent as an integer between 0 and n-1.
Sender encrypts the message using the public key of receiver.
It raises the plain text message ‘P’ to the eth power modulo n.
This converts the message into cipher text ‘C’.
C = Pe mod n
Step-02:
The cipher text ‘C’ is sent to the receiver over the communication channel.
Step-03:
At receiver side,
Receiver decrypts the cipher text using his private key.
It raises the cipher text ‘C’ to the dth power modulo n.
This converts the cipher text back into the plain text ‘P’.
P = Cd mod n
NOTE-
An individual can generate his public key and private key using the following steps-
Step-01:
Step-02:
Step-03:
Step-04:
Problem-01:
Solution-
Given-
Prime numbers p = 13 and q = 17
Public key = 35
Step-01:
Value of n,
n=pxq
n = 13 x 17
∴ n = 221
Toilent function,
Ø(n) = (p-1) x (q-1)
Ø(n) = (13-1) x (17-1)
∴ Ø(n) = 192
Step-02:
Step-03:
Here,
The least value of ‘k’ which gives the integer value of ‘d’ is k = 2.
On substituting k = 2, we get d = 11.
Problem-02:
In the RSA public key cryptosystem, the private and public keys are (e, n) and (d, n)
respectively, where n = p x q and p and q are large primes. Besides, n is public and p and q
are private. Let M be an integer such that 0 < M < n and f(n) = (p-1)(q-1).
Solution-
Clearly, Option (B) is correct.