2
Most read
6
Most read
7
Most read
GANDHINAGAR INSTITUTE OF TECHNOLGY
Department of Information Technology
Diffie-Hellman Key Algorithm
Group ID: IT_B1_00
Student Name(Enroll No): Shaishav Shah(170120116094)
Name of Faculty: Prof. Alpa Oza
INS(2170709)
Introduction
• The Diffie-Hellman key agreement protocol was developed by
Diffie and Hellman in 1976.
• This protocol allows two users to exchange a secret key over an
insecure medium without any prior secrets.
• The protocol has two system parameters p and g.
• They are both public and may be used by all users in a system.
• Parameter p is a prime number and parameter g is an integer less
than p, with the following property:
– For every number n between 1 and p – 1 inclusive.
– There is a power k of g such that n = 𝑔𝑘
𝑚𝑜𝑑 𝑝.
Introduction
• The protocol depends on the discrete algorithm problem for its
security.
• It assumes that it is computationally infeasible to calculate the
shared secret key 𝑘 = 𝑔𝑎𝑏 𝑚𝑜𝑑 𝑝 given the two public values
𝑔𝑎 𝑚𝑜𝑑 𝑝 and 𝑔𝑏 𝑚𝑜𝑑 𝑝 when the prime p is sufficiently large.
• The Diffie – Hellman key exchange is vulnerable to a man-in-the-
middle attack.
• This vulnerability is present because Diffie-Hellman key exchange
does not authenticate the participants.
• Possible solutions include the use of digital signatures and other
protocol variants.
Algorithm
• Select two numbers:
1. Prime number 𝑞.
2. 𝛼 an integer that is a primitive root of 𝑞.
• Suppose the users A and B wish to exchange a key.
1. User A select a random integer 𝑋𝐴 < 𝑞 and computes
𝑌
𝐴 = 𝛼𝑋𝐴 𝑚𝑜𝑑 𝑞.
2. User A select a random integer 𝑋𝐵 < 𝑞 and computes
𝑌𝐵 = 𝛼𝑋𝐵 𝑚𝑜𝑑 𝑞.
3. Both side keeps the X value private and makes the Y
value available publicly to the other sides.
4. User A computes the key as 𝐾 = (𝑌𝐵)𝑋𝐴 𝑚𝑜𝑑 𝑞.
5. User B computes the key as 𝐾 = (𝑌𝐴)𝑋𝐵 𝑚𝑜𝑑 𝑞.
Algorithm
• Both side gets same results:
𝐾 = (𝑌𝐵)𝑋𝐴 𝑚𝑜𝑑 𝑞 = (𝛼𝑋𝐵 𝑚𝑜𝑑 𝑞)𝑋𝐴 𝑚𝑜𝑑 𝑞
= (𝛼𝑋𝐵)𝑋𝐴 𝑚𝑜𝑑 𝑞 = 𝛼𝑋𝐵𝑋𝐴𝑚𝑜𝑑 𝑞
= (𝛼𝑋𝐴 𝑚𝑜𝑑 𝑞)𝑋𝐵 𝑚𝑜𝑑 𝑞 = (𝑌𝐴)𝑋𝐵 𝑚𝑜𝑑 𝑞
Example
User A and User B use the Diffie-Hellman key exchange technique
with a common prime 𝑞 = 17 and a primitive root 𝛼 = 7.
a) If user A has private key 𝑋𝐴 = 5, what is A’s public key 𝑌
𝐴?
b) If user B has private key 𝑋𝐵 = 12, what is B’s public key 𝑌𝐵?
c) What is the shared secret key?
Solution:
a) A’s public key 𝒀𝑨
𝑌
𝐴 = 𝛼𝑋𝐴 𝑚𝑜𝑑 𝑞 = (7)5
𝑚𝑜𝑑 71 = 16807 mod 71 = 51
b) B’s public key 𝒀𝑩
𝑌𝐵 = 𝛼𝑋𝐵 𝑚𝑜𝑑 𝑞 = (7)12 𝑚𝑜𝑑 71 = 13841287201 mod 71 = 4
c) A’s public key 𝒀𝑨
𝐾 = (𝑌𝐵)𝑋𝐴 𝑚𝑜𝑑 𝑞 = (4)5 𝑚𝑜𝑑 71
= 1024 𝑚𝑜𝑑 71 = 30
Advantages
1. Any user can choose a random x and publish 𝑔𝑥 in a public
database such as a phone book.
2. Phone book must be maintained by a TTP.
3. Other users can look up the database and get the public key
for the individual and use it to encrypt the message.
4. Ideal for use with emails.
Disadvantages
1. Does not protect against man in middle attacks.
2. Even can intercept all traffic between Alice and Bob and
generate separate keys for communication with them.
3. If Alice sends an encrypted message for Bob with his public
key, Even simply forwards it.
4. For large prime 𝑝, 𝑝 − 1 is an even number and so 𝑍𝑝
∗ will
have an subgroup of order 2.
Thank You

More Related Content

PPT
Polyalphabetic Substitution Cipher
PPTX
Public Key Cryptosystem
PDF
Computer Security Lecture 7: RSA
PPT
Message Authentication
PDF
Data types in c++
PPTX
Web Security
PDF
Public Key Encryption & Hash functions
PPTX
Rsa cryptosystem
Polyalphabetic Substitution Cipher
Public Key Cryptosystem
Computer Security Lecture 7: RSA
Message Authentication
Data types in c++
Web Security
Public Key Encryption & Hash functions
Rsa cryptosystem

What's hot (20)

PPTX
Trusted systems
PPTX
IP Security
PPTX
Cryptography and steganography
PPTX
Encryption algorithms
PPTX
Diffie Hellman Key Exchange
PDF
basic encryption and decryption
PPTX
Cryptographic algorithms
PPTX
Command line arguments
PPTX
hill cipher
ODP
Email security
PPTX
5. message authentication and hash function
PPTX
Web security
PPTX
PPTX
What is identifier c programming
PPTX
array of object pointer in c++
PPTX
The origin and evaluation criteria of aes
PDF
IP Security
PPT
Message Authentication Code & HMAC
PDF
Cs8792 cns - unit iv
PPTX
Block cipher modes of operation
Trusted systems
IP Security
Cryptography and steganography
Encryption algorithms
Diffie Hellman Key Exchange
basic encryption and decryption
Cryptographic algorithms
Command line arguments
hill cipher
Email security
5. message authentication and hash function
Web security
What is identifier c programming
array of object pointer in c++
The origin and evaluation criteria of aes
IP Security
Message Authentication Code & HMAC
Cs8792 cns - unit iv
Block cipher modes of operation
Ad

Similar to Diffie hellman key algorithm (20)

PPT
Rsa diffi-network security-itt
PPT
Unit - 3.ppt
PPTX
RSA - ALGORITHM by Muthugomathy and Meenakshi Shetti of GIT COLLEGE
PDF
international security system data threats
PDF
PRINCIPLES OF INFORMATION SYSTEM SECURITY
PPT
Rsa and diffie hellman algorithms
PPTX
Parallel processing -open mp
PDF
parallelprocessing-openmp-181105062408.pdf
DOC
PPT
Information and Network Security
PPTX
Information and network security 32 principles of public key cryptosystems
DOCX
PPTX
Asymmetric Ciphers in Networks and Security.pptx
PPTX
Module 2 of cryptography old scheme VTU ppt
PPTX
engineering cryptography pptxmodule 4 rsa.pptx
PPTX
Public key algorithm
PPT
KEY MGMT.ppt
PPTX
Cryptography 101
Rsa diffi-network security-itt
Unit - 3.ppt
RSA - ALGORITHM by Muthugomathy and Meenakshi Shetti of GIT COLLEGE
international security system data threats
PRINCIPLES OF INFORMATION SYSTEM SECURITY
Rsa and diffie hellman algorithms
Parallel processing -open mp
parallelprocessing-openmp-181105062408.pdf
Information and Network Security
Information and network security 32 principles of public key cryptosystems
Asymmetric Ciphers in Networks and Security.pptx
Module 2 of cryptography old scheme VTU ppt
engineering cryptography pptxmodule 4 rsa.pptx
Public key algorithm
KEY MGMT.ppt
Cryptography 101
Ad

More from ShaishavShah8 (19)

PPTX
Constructor oopj
PPTX
Clipping computer graphics
PPTX
Classification of debuggers sp
PPTX
Parallel and perspective projection in 3 d cg
PPTX
Asymptotic notations ada
PPT
Arrays in java oopj
PPTX
Classical cyphers python programming
PPTX
Logics for non monotonic reasoning-ai
PPTX
Rdd transformations bda
PPT
Introduction to data warehouse dmbi
PPT
Lan, wan, man mcwc
PPT
Introduction to xml, uses of xml wt
PPTX
Agile process se
PPTX
Applications of huffman coding dcdr
PPTX
Cookie management using jsp a java
PPTX
Login control .net
PPTX
Rdd transformations
PPTX
LAN, WAN, MAN
PPTX
Introduction to data warehouse
Constructor oopj
Clipping computer graphics
Classification of debuggers sp
Parallel and perspective projection in 3 d cg
Asymptotic notations ada
Arrays in java oopj
Classical cyphers python programming
Logics for non monotonic reasoning-ai
Rdd transformations bda
Introduction to data warehouse dmbi
Lan, wan, man mcwc
Introduction to xml, uses of xml wt
Agile process se
Applications of huffman coding dcdr
Cookie management using jsp a java
Login control .net
Rdd transformations
LAN, WAN, MAN
Introduction to data warehouse

Recently uploaded (20)

PPTX
Web Crawler for Trend Tracking Gen Z Insights.pptx
PDF
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PDF
A novel scalable deep ensemble learning framework for big data classification...
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PPTX
O2C Customer Invoices to Receipt V15A.pptx
PDF
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
PDF
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
Taming the Chaos: How to Turn Unstructured Data into Decisions
PDF
Zenith AI: Advanced Artificial Intelligence
PPT
What is a Computer? Input Devices /output devices
DOCX
search engine optimization ppt fir known well about this
PDF
sustainability-14-14877-v2.pddhzftheheeeee
PPT
Geologic Time for studying geology for geologist
PPTX
Modernising the Digital Integration Hub
PDF
CloudStack 4.21: First Look Webinar slides
PDF
August Patch Tuesday
PDF
Getting Started with Data Integration: FME Form 101
Web Crawler for Trend Tracking Gen Z Insights.pptx
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
A novel scalable deep ensemble learning framework for big data classification...
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
O2C Customer Invoices to Receipt V15A.pptx
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
1 - Historical Antecedents, Social Consideration.pdf
Taming the Chaos: How to Turn Unstructured Data into Decisions
Zenith AI: Advanced Artificial Intelligence
What is a Computer? Input Devices /output devices
search engine optimization ppt fir known well about this
sustainability-14-14877-v2.pddhzftheheeeee
Geologic Time for studying geology for geologist
Modernising the Digital Integration Hub
CloudStack 4.21: First Look Webinar slides
August Patch Tuesday
Getting Started with Data Integration: FME Form 101

Diffie hellman key algorithm

  • 1. GANDHINAGAR INSTITUTE OF TECHNOLGY Department of Information Technology Diffie-Hellman Key Algorithm Group ID: IT_B1_00 Student Name(Enroll No): Shaishav Shah(170120116094) Name of Faculty: Prof. Alpa Oza INS(2170709)
  • 2. Introduction • The Diffie-Hellman key agreement protocol was developed by Diffie and Hellman in 1976. • This protocol allows two users to exchange a secret key over an insecure medium without any prior secrets. • The protocol has two system parameters p and g. • They are both public and may be used by all users in a system. • Parameter p is a prime number and parameter g is an integer less than p, with the following property: – For every number n between 1 and p – 1 inclusive. – There is a power k of g such that n = 𝑔𝑘 𝑚𝑜𝑑 𝑝.
  • 3. Introduction • The protocol depends on the discrete algorithm problem for its security. • It assumes that it is computationally infeasible to calculate the shared secret key 𝑘 = 𝑔𝑎𝑏 𝑚𝑜𝑑 𝑝 given the two public values 𝑔𝑎 𝑚𝑜𝑑 𝑝 and 𝑔𝑏 𝑚𝑜𝑑 𝑝 when the prime p is sufficiently large. • The Diffie – Hellman key exchange is vulnerable to a man-in-the- middle attack. • This vulnerability is present because Diffie-Hellman key exchange does not authenticate the participants. • Possible solutions include the use of digital signatures and other protocol variants.
  • 4. Algorithm • Select two numbers: 1. Prime number 𝑞. 2. 𝛼 an integer that is a primitive root of 𝑞. • Suppose the users A and B wish to exchange a key. 1. User A select a random integer 𝑋𝐴 < 𝑞 and computes 𝑌 𝐴 = 𝛼𝑋𝐴 𝑚𝑜𝑑 𝑞. 2. User A select a random integer 𝑋𝐵 < 𝑞 and computes 𝑌𝐵 = 𝛼𝑋𝐵 𝑚𝑜𝑑 𝑞. 3. Both side keeps the X value private and makes the Y value available publicly to the other sides. 4. User A computes the key as 𝐾 = (𝑌𝐵)𝑋𝐴 𝑚𝑜𝑑 𝑞. 5. User B computes the key as 𝐾 = (𝑌𝐴)𝑋𝐵 𝑚𝑜𝑑 𝑞.
  • 5. Algorithm • Both side gets same results: 𝐾 = (𝑌𝐵)𝑋𝐴 𝑚𝑜𝑑 𝑞 = (𝛼𝑋𝐵 𝑚𝑜𝑑 𝑞)𝑋𝐴 𝑚𝑜𝑑 𝑞 = (𝛼𝑋𝐵)𝑋𝐴 𝑚𝑜𝑑 𝑞 = 𝛼𝑋𝐵𝑋𝐴𝑚𝑜𝑑 𝑞 = (𝛼𝑋𝐴 𝑚𝑜𝑑 𝑞)𝑋𝐵 𝑚𝑜𝑑 𝑞 = (𝑌𝐴)𝑋𝐵 𝑚𝑜𝑑 𝑞
  • 6. Example User A and User B use the Diffie-Hellman key exchange technique with a common prime 𝑞 = 17 and a primitive root 𝛼 = 7. a) If user A has private key 𝑋𝐴 = 5, what is A’s public key 𝑌 𝐴? b) If user B has private key 𝑋𝐵 = 12, what is B’s public key 𝑌𝐵? c) What is the shared secret key? Solution: a) A’s public key 𝒀𝑨 𝑌 𝐴 = 𝛼𝑋𝐴 𝑚𝑜𝑑 𝑞 = (7)5 𝑚𝑜𝑑 71 = 16807 mod 71 = 51 b) B’s public key 𝒀𝑩 𝑌𝐵 = 𝛼𝑋𝐵 𝑚𝑜𝑑 𝑞 = (7)12 𝑚𝑜𝑑 71 = 13841287201 mod 71 = 4 c) A’s public key 𝒀𝑨 𝐾 = (𝑌𝐵)𝑋𝐴 𝑚𝑜𝑑 𝑞 = (4)5 𝑚𝑜𝑑 71 = 1024 𝑚𝑜𝑑 71 = 30
  • 7. Advantages 1. Any user can choose a random x and publish 𝑔𝑥 in a public database such as a phone book. 2. Phone book must be maintained by a TTP. 3. Other users can look up the database and get the public key for the individual and use it to encrypt the message. 4. Ideal for use with emails.
  • 8. Disadvantages 1. Does not protect against man in middle attacks. 2. Even can intercept all traffic between Alice and Bob and generate separate keys for communication with them. 3. If Alice sends an encrypted message for Bob with his public key, Even simply forwards it. 4. For large prime 𝑝, 𝑝 − 1 is an even number and so 𝑍𝑝 ∗ will have an subgroup of order 2.