SlideShare a Scribd company logo
2
Most read
4
Most read
6
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
Ad

Recommended

Kerberos : An Authentication Application
Kerberos : An Authentication Application
Vidulatiwari
 
symmetric key encryption algorithms
symmetric key encryption algorithms
Rashmi Burugupalli
 
Information Security (Digital Signatures)
Information Security (Digital Signatures)
Zara Nawaz
 
Information and network security 13 playfair cipher
Information and network security 13 playfair cipher
Vaibhav Khanna
 
Unit 2
Unit 2
KRAMANJANEYULU1
 
MD5 ALGORITHM.pptx
MD5 ALGORITHM.pptx
Rajapriya82
 
Diffie-hellman algorithm
Diffie-hellman algorithm
Computer_ at_home
 
Symmetric and Asymmetric Encryption.ppt
Symmetric and Asymmetric Encryption.ppt
HassanAli980906
 
Message authentication
Message authentication
CAS
 
2. public key cryptography and RSA
2. public key cryptography and RSA
Dr.Florence Dayana
 
Public Key Cryptosystem
Public Key Cryptosystem
Devakumar Kp
 
Diffie Hellman Key Exchange
Diffie Hellman Key Exchange
SAURABHDHAGE6
 
13. Query Processing in DBMS
13. Query Processing in DBMS
koolkampus
 
DES (Data Encryption Standard) pressentation
DES (Data Encryption Standard) pressentation
sarhadisoftengg
 
Public Key Cryptography
Public Key Cryptography
Gopal Sakarkar
 
Email Security Pretty Good Privacy (PGP),Services Provided by PGP.pdf
Email Security Pretty Good Privacy (PGP),Services Provided by PGP.pdf
aryalmadhave123
 
Grasp patterns and its types
Grasp patterns and its types
Syed Hassan Ali
 
Operator precedence
Operator precedence
Akshaya Arunan
 
Hash Function
Hash Function
ssuserdfb2da
 
X.509 Certificates
X.509 Certificates
Sou Jana
 
block ciphers
block ciphers
Asad Ali
 
Peephole optimization techniques in compiler design
Peephole optimization techniques in compiler design
Anul Chaudhary
 
Diffie Hellman.pptx
Diffie Hellman.pptx
Sou Jana
 
Interconnection Network
Interconnection Network
Heman Pathak
 
Digital signature schemes
Digital signature schemes
ravik09783
 
Information Security & Cryptography
Information Security & Cryptography
Arun ACE
 
SCHEDULING ALGORITHMS
SCHEDULING ALGORITHMS
Dhaval Sakhiya
 
Substitution techniques
Substitution techniques
vinitha96
 
Rsa diffi-network security-itt
Rsa diffi-network security-itt
rameshvvv
 
Unit - 3.ppt
Unit - 3.ppt
DHANABALSUBRAMANIAN
 

More Related Content

What's hot (20)

Message authentication
Message authentication
CAS
 
2. public key cryptography and RSA
2. public key cryptography and RSA
Dr.Florence Dayana
 
Public Key Cryptosystem
Public Key Cryptosystem
Devakumar Kp
 
Diffie Hellman Key Exchange
Diffie Hellman Key Exchange
SAURABHDHAGE6
 
13. Query Processing in DBMS
13. Query Processing in DBMS
koolkampus
 
DES (Data Encryption Standard) pressentation
DES (Data Encryption Standard) pressentation
sarhadisoftengg
 
Public Key Cryptography
Public Key Cryptography
Gopal Sakarkar
 
Email Security Pretty Good Privacy (PGP),Services Provided by PGP.pdf
Email Security Pretty Good Privacy (PGP),Services Provided by PGP.pdf
aryalmadhave123
 
Grasp patterns and its types
Grasp patterns and its types
Syed Hassan Ali
 
Operator precedence
Operator precedence
Akshaya Arunan
 
Hash Function
Hash Function
ssuserdfb2da
 
X.509 Certificates
X.509 Certificates
Sou Jana
 
block ciphers
block ciphers
Asad Ali
 
Peephole optimization techniques in compiler design
Peephole optimization techniques in compiler design
Anul Chaudhary
 
Diffie Hellman.pptx
Diffie Hellman.pptx
Sou Jana
 
Interconnection Network
Interconnection Network
Heman Pathak
 
Digital signature schemes
Digital signature schemes
ravik09783
 
Information Security & Cryptography
Information Security & Cryptography
Arun ACE
 
SCHEDULING ALGORITHMS
SCHEDULING ALGORITHMS
Dhaval Sakhiya
 
Substitution techniques
Substitution techniques
vinitha96
 
Message authentication
Message authentication
CAS
 
2. public key cryptography and RSA
2. public key cryptography and RSA
Dr.Florence Dayana
 
Public Key Cryptosystem
Public Key Cryptosystem
Devakumar Kp
 
Diffie Hellman Key Exchange
Diffie Hellman Key Exchange
SAURABHDHAGE6
 
13. Query Processing in DBMS
13. Query Processing in DBMS
koolkampus
 
DES (Data Encryption Standard) pressentation
DES (Data Encryption Standard) pressentation
sarhadisoftengg
 
Public Key Cryptography
Public Key Cryptography
Gopal Sakarkar
 
Email Security Pretty Good Privacy (PGP),Services Provided by PGP.pdf
Email Security Pretty Good Privacy (PGP),Services Provided by PGP.pdf
aryalmadhave123
 
Grasp patterns and its types
Grasp patterns and its types
Syed Hassan Ali
 
X.509 Certificates
X.509 Certificates
Sou Jana
 
block ciphers
block ciphers
Asad Ali
 
Peephole optimization techniques in compiler design
Peephole optimization techniques in compiler design
Anul Chaudhary
 
Diffie Hellman.pptx
Diffie Hellman.pptx
Sou Jana
 
Interconnection Network
Interconnection Network
Heman Pathak
 
Digital signature schemes
Digital signature schemes
ravik09783
 
Information Security & Cryptography
Information Security & Cryptography
Arun ACE
 
Substitution techniques
Substitution techniques
vinitha96
 

Similar to Diffie hellman key algorithm (20)

Rsa diffi-network security-itt
Rsa diffi-network security-itt
rameshvvv
 
Unit - 3.ppt
Unit - 3.ppt
DHANABALSUBRAMANIAN
 
RSA - ALGORITHM by Muthugomathy and Meenakshi Shetti of GIT COLLEGE
RSA - ALGORITHM by Muthugomathy and Meenakshi Shetti of GIT COLLEGE
Qualcomm
 
international security system data threats
international security system data threats
gacop74666
 
PRINCIPLES OF INFORMATION SYSTEM SECURITY
PRINCIPLES OF INFORMATION SYSTEM SECURITY
gacop74666
 
Rsa and diffie hellman algorithms
Rsa and diffie hellman algorithms
daxesh chauhan
 
Parallel processing -open mp
Parallel processing -open mp
Tanjilla Sarkar
 
parallelprocessing-openmp-181105062408.pdf
parallelprocessing-openmp-181105062408.pdf
bosdhoni7378
 
Ch10
Ch10
Joe Christensen
 
Unit 3(1)
Unit 3(1)
Vinod Kumar Gorrepati
 
Information and Network Security
Information and Network Security
Maulik Togadiya
 
Ch9
Ch9
Mahender Kumar
 
Information and network security 32 principles of public key cryptosystems
Information and network security 32 principles of public key cryptosystems
Vaibhav Khanna
 
Unit 3(1)
Unit 3(1)
Vinod Kumar Gorrepati
 
Asymmetric Ciphers in Networks and Security.pptx
Asymmetric Ciphers in Networks and Security.pptx
VivekanandaGN1
 
Module 2 of cryptography old scheme VTU ppt
Module 2 of cryptography old scheme VTU ppt
MonaReddy12
 
engineering cryptography pptxmodule 4 rsa.pptx
engineering cryptography pptxmodule 4 rsa.pptx
shaziasulthana2
 
Public key algorithm
Public key algorithm
Prateek Pandey
 
KEY MGMT.ppt
KEY MGMT.ppt
RizwanBasha12
 
Cryptography 101
Cryptography 101
Aditya Kamat
 
Rsa diffi-network security-itt
Rsa diffi-network security-itt
rameshvvv
 
RSA - ALGORITHM by Muthugomathy and Meenakshi Shetti of GIT COLLEGE
RSA - ALGORITHM by Muthugomathy and Meenakshi Shetti of GIT COLLEGE
Qualcomm
 
international security system data threats
international security system data threats
gacop74666
 
PRINCIPLES OF INFORMATION SYSTEM SECURITY
PRINCIPLES OF INFORMATION SYSTEM SECURITY
gacop74666
 
Rsa and diffie hellman algorithms
Rsa and diffie hellman algorithms
daxesh chauhan
 
Parallel processing -open mp
Parallel processing -open mp
Tanjilla Sarkar
 
parallelprocessing-openmp-181105062408.pdf
parallelprocessing-openmp-181105062408.pdf
bosdhoni7378
 
Information and Network Security
Information and Network Security
Maulik Togadiya
 
Information and network security 32 principles of public key cryptosystems
Information and network security 32 principles of public key cryptosystems
Vaibhav Khanna
 
Asymmetric Ciphers in Networks and Security.pptx
Asymmetric Ciphers in Networks and Security.pptx
VivekanandaGN1
 
Module 2 of cryptography old scheme VTU ppt
Module 2 of cryptography old scheme VTU ppt
MonaReddy12
 
engineering cryptography pptxmodule 4 rsa.pptx
engineering cryptography pptxmodule 4 rsa.pptx
shaziasulthana2
 
Ad

More from ShaishavShah8 (19)

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

Recently uploaded (20)

Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Priyanka Aash
 
9-1-1 Addressing: End-to-End Automation Using FME
9-1-1 Addressing: End-to-End Automation Using FME
Safe Software
 
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
revolcs10
 
"Scaling in space and time with Temporal", Andriy Lupa.pdf
"Scaling in space and time with Temporal", Andriy Lupa.pdf
Fwdays
 
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
Connecting Data and Intelligence: The Role of FME in Machine Learning
Connecting Data and Intelligence: The Role of FME in Machine Learning
Safe Software
 
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik
 
OpenPOWER Foundation & Open-Source Core Innovations
OpenPOWER Foundation & Open-Source Core Innovations
IBM
 
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
Priyanka Aash
 
Security Tips for Enterprise Azure Solutions
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
 
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Priyanka Aash
 
AI Agents and FME: A How-to Guide on Generating Synthetic Metadata
AI Agents and FME: A How-to Guide on Generating Synthetic Metadata
Safe Software
 
"Database isolation: how we deal with hundreds of direct connections to the d...
"Database isolation: how we deal with hundreds of direct connections to the d...
Fwdays
 
Cyber Defense Matrix Workshop - RSA Conference
Cyber Defense Matrix Workshop - RSA Conference
Priyanka Aash
 
Mastering AI Workflows with FME by Mark Döring
Mastering AI Workflows with FME by Mark Döring
Safe Software
 
The Future of Product Management in AI ERA.pdf
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
Daily Lesson Log MATATAG ICT TEchnology 8
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
 
UserCon Belgium: Honey, VMware increased my bill
UserCon Belgium: Honey, VMware increased my bill
stijn40
 
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
caoyixuan2019
 
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Priyanka Aash
 
9-1-1 Addressing: End-to-End Automation Using FME
9-1-1 Addressing: End-to-End Automation Using FME
Safe Software
 
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
revolcs10
 
"Scaling in space and time with Temporal", Andriy Lupa.pdf
"Scaling in space and time with Temporal", Andriy Lupa.pdf
Fwdays
 
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
Connecting Data and Intelligence: The Role of FME in Machine Learning
Connecting Data and Intelligence: The Role of FME in Machine Learning
Safe Software
 
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik
 
OpenPOWER Foundation & Open-Source Core Innovations
OpenPOWER Foundation & Open-Source Core Innovations
IBM
 
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
Priyanka Aash
 
Security Tips for Enterprise Azure Solutions
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
 
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Priyanka Aash
 
AI Agents and FME: A How-to Guide on Generating Synthetic Metadata
AI Agents and FME: A How-to Guide on Generating Synthetic Metadata
Safe Software
 
"Database isolation: how we deal with hundreds of direct connections to the d...
"Database isolation: how we deal with hundreds of direct connections to the d...
Fwdays
 
Cyber Defense Matrix Workshop - RSA Conference
Cyber Defense Matrix Workshop - RSA Conference
Priyanka Aash
 
Mastering AI Workflows with FME by Mark Döring
Mastering AI Workflows with FME by Mark Döring
Safe Software
 
The Future of Product Management in AI ERA.pdf
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
Daily Lesson Log MATATAG ICT TEchnology 8
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
 
UserCon Belgium: Honey, VMware increased my bill
UserCon Belgium: Honey, VMware increased my bill
stijn40
 
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
caoyixuan2019
 

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.