Professional Documents
Culture Documents
Experiment No: 4: Title: Aim
Experiment No: 4: Title: Aim
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
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.
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) .
Many protocol uses Diffie-Hellman algorithm to enhance security and few of them are:
Output:
Conclusion:
We studied Private-Key Cryptosystems and performed Diffie-Hellman algorithm and learned its
advantages application and possible attacks.