Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

EXPERIMENT NO: 4

Name of the Student: - Monica Monindra Chakraborty


Roll No. 11 Subject:- SL
Date of Practical Performed :-___________ Staff Signature with Date
&Marks

Title: To study the implementation of private key cryptosystem.


Aim: To study secret key or private key cryptography technique - Diffie-Hellman key exchange
protocol

Theory:
Private-Key Cryptosystems
A private key, also known as a secret key, is a variable in cryptography that is used with an algorithm to
encrypt and decrypt code. Private key encryption is the form of encryption where only a single private key can
encrypt and decrypt information. It is a fast process since it uses a single key

Symmetric key cryptography


Symmetric encryption is a type of encryption where only one key (a secret key) is used to both encrypt and
decrypt electronic information. The entities communicating via symmetric encryption must exchange the key
so that it can be used in the decryption process. This encryption method differs from asymmetric encryption
where a pair of keys, one public and one private, is used to encrypt and decrypt messages .

Diffie hellman algorithm

Diffie Hellman algorithm is used only for key agreement not for Encryption or decryption of message. If
sender and receiver want to communicate with each other they first agree on same key generated by Diffie
Hellman Algorithm later on they can use this key for encryption or decryption.

Steps for Diffie-Hellman Algorithm:

Step1: The first step is that if sender wants to communicate with receiver they must agree on two large prime
numbers p and q.
step2:Sender selects another secret large random integer number a,and calculate R such that R=q^a mod p
Step3:Sender sends this R to receiver
step4:Receiver independently selects another secret large random integer number b:and calculte S such that
S=q^b mod p
step5:Receiver sends the number S to Sender
step6:Now sender is calculating his secret key by using Rk=S^q mod P
step7:Receiver is calculating his secret key by Sk by using Sk=R^b mod p
step8:If Rk=Sk then Sender and Receiver can agree for future communication called as key agreement
algorithm
step9:we have Rk=Sk=K hence proved.(K is called symmetric key) .

Example of Diffie Hellman


Application Diffie Hellman Algorithm:

Many protocol uses Diffie-Hellman algorithm to enhance security and few of them are:

 Secure Shell (SSH)


 Transport Layer Security (TLS) / Secure Sockets Layer (SSL)
 Public Key Infrastructure (PKI)
 Internet Key Exchange (IKE)
 Internet Protocol Security (IPSec)

Advantage of Diffie Hellman Algorithm


The sender and receiver don’t need any prior knowledge of each other.
Once the keys are exchanged, the communication of data can be done through an insecure channel.
The sharing of the secret key is safe.

Possible Attacks on this technique


Man-in-the-Middle attack is very much possible on the existing Diffie-Hellman algorithm. In man-in-the-
middle attack, the attacker exists in the public channel, the attacker receives the public key of both sender and
receiver and sends public keys to sender and receiver which is generated by his own.

Output:
Conclusion:
We studied Private-Key Cryptosystems and performed Diffie-Hellman algorithm and learned its
advantages application and possible attacks.

You might also like