Diffie Hellman
algorithm
Flaw in Symmetric encryption
• Symmetric encryption has always been a reliable method of
cryptography for the exchange of private information.
• A glaring flaw has always been the difficulty in sharing the
requisite secret key with the receiver of the message.
• It can intercept any key transmitted over an insecure channel by
hackers, who can then use the same key to decrypt the
encrypted ciphertexts.
Diffie Hellman algorithm
• The Diffie-Hellman algorithm is a method for securely
exchanging cryptographic keys over insecure channels without
compromising the security and integrity of data transmission.
• It was developed and published in 1976 by Martin Hellman and
Whitefield Diffie.
• This algorithm is used to exchange the secret key between the
sender and the receiver.
• This algorithm facilitates the exchange of secret key without
actually transmitting it.
How does Diffie-Hellman key exchange work?
• To implement Diffie-Hellman, two end users, Alice and Bob,
mutually agree on positive whole numbers p and q, such that p
is a prime number and q is a generator of p.
• The generator q is a number that, when raised to positive whole-
number powers less than p, never produces the same result for
any two such whole numbers.
• The value of p may be large, but the value of q is usually small.
How does Diffie-Hellman key exchange work?
• Once Alice and Bob have agreed on p and q in private,
they choose positive whole-number personal
keys a and b.
• Both a and b are less than the prime number
modulus p.
• Next, Alice and Bob compute public
keys a* and b* based on their personal keys according
to the following formulas:
How does Diffie-Hellman key exchange work?
• The two users can share their public keys a* and b* over a
communications medium assumed to be insecure, such as the
internet or a corporate wide area network. From these public
keys, a number x can be generated by either user on the basis
of their own personal keys. Alice computes x using the
following formula:
x = (b*) mod p
• Bob computes x using the following formula:
x = (a*) mod p
• The value of x turns out to be the same according to either of
the above two formulas.
How Diffie-Hellman key exchange is secure?
• However, the personal keys a and b, which are critical in
the calculation of x, haven't been transmitted over a
public medium.
• Because it's a large and apparently random number, a
potential hacker has almost no chance of correctly
guessing x, even with the help of a powerful computer
to conduct millions of trials.
• The two users can, therefore, in theory, communicate
privately over a public medium with an encryption
method of their choice using the decryption key x.
Summary Diffie-Hellman key exchange
Alice Bob
Public Keys available = p, q Public Keys available =p,q
Private Key Selected = a Private Key Selected = b
Key generated = Key generated =
Exchange of generated keys takes place
Key received = key received =
Generated Secret Key =
(b*)^a mod p
Generated Secret Key =
(a*)^b mod p
Users now have a symmetric secret key to encrypt
Example:
• Step 1: Alice and Bob get public numbers p = 23, q = 9
• Step 2: Alice selected a private key a = 4 and
• Bob selected a private key b = 3
• Step 3: Alice and Bob compute public values. Find and
• Alice: =(9^4 mod 23) = (6561 mod 23) = 6
• Bob: = (9^3 mod 23) = (729 mod 23) = 16
• Step 4: Alice and Bob exchange public numbers
• Step 5: Alice receives public key y =16 and
• Bob receives public key x = 6
• Step 6: Find the symmetric keys of Alice and Bob
• Alice: ^a mod p = 65536 mod 23 = 9
• Bob: a ^b mod p = 216 mod 23 = 9
• Step 7: 9 is the shared secret.
Example:
• Example: Alice and Bob agree on g =2 and p = 13.
• Alice chooses a = 3; this is her private key and Bob chooses b = 7
for his private key.
• Find their secret Key.
• Sol
• Generated Secret Key =
(11^3) mod 13= (8^7) mod 13=5
Example:
• Suppose that two parties A and B wish to set up a
common secret key (D-H key) between themselves
using the Diffie Hellman key exchange technique. They
agree on 7 as the modulus and 3 as the primitive root.
Party A chooses 2 and party B chooses 5 as their
respective secrets. Their D-H key is-
a) 3
b) 4
c) 5
d) 6
Example:
• Suppose that two parties A and B wish to set up a
common secret key (D-H key) between themselves
using the Diffie Hellman key exchange technique. They
agree on 7 as the modulus and 3 as the primitive root.
Party A chooses 2 and party B chooses 5 as their
respective secrets. Their D-H key is-
• 3
• 4
• 5
• 6
Example:
• In a Diffie-Hellman Key Exchange, Alice and Bob have
chosen prime value q = 17 and primitive root = 5. If
Alice’s secret key is 4 and Bob’s secret key is 6, what is
the secret key they exchanged?
a) 16
b) 17
c) 18
d) 19
Example:
• In a Diffie-Hellman Key Exchange, Alice and Bob have
chosen prime value q = 17 and primitive root = 5. If
Alice’s secret key is 4 and Bob’s secret key is 6, what is
the secret key they exchanged?
a) 16
b) 17
c) 18
d) 19

4_Diffie Hellman algorithm for graduates.pptx

  • 1.
  • 2.
    Flaw in Symmetricencryption • Symmetric encryption has always been a reliable method of cryptography for the exchange of private information. • A glaring flaw has always been the difficulty in sharing the requisite secret key with the receiver of the message. • It can intercept any key transmitted over an insecure channel by hackers, who can then use the same key to decrypt the encrypted ciphertexts.
  • 3.
    Diffie Hellman algorithm •The Diffie-Hellman algorithm is a method for securely exchanging cryptographic keys over insecure channels without compromising the security and integrity of data transmission. • It was developed and published in 1976 by Martin Hellman and Whitefield Diffie. • This algorithm is used to exchange the secret key between the sender and the receiver. • This algorithm facilitates the exchange of secret key without actually transmitting it.
  • 4.
    How does Diffie-Hellmankey exchange work? • To implement Diffie-Hellman, two end users, Alice and Bob, mutually agree on positive whole numbers p and q, such that p is a prime number and q is a generator of p. • The generator q is a number that, when raised to positive whole- number powers less than p, never produces the same result for any two such whole numbers. • The value of p may be large, but the value of q is usually small.
  • 5.
    How does Diffie-Hellmankey exchange work? • Once Alice and Bob have agreed on p and q in private, they choose positive whole-number personal keys a and b. • Both a and b are less than the prime number modulus p. • Next, Alice and Bob compute public keys a* and b* based on their personal keys according to the following formulas:
  • 6.
    How does Diffie-Hellmankey exchange work? • The two users can share their public keys a* and b* over a communications medium assumed to be insecure, such as the internet or a corporate wide area network. From these public keys, a number x can be generated by either user on the basis of their own personal keys. Alice computes x using the following formula: x = (b*) mod p • Bob computes x using the following formula: x = (a*) mod p • The value of x turns out to be the same according to either of the above two formulas.
  • 7.
    How Diffie-Hellman keyexchange is secure? • However, the personal keys a and b, which are critical in the calculation of x, haven't been transmitted over a public medium. • Because it's a large and apparently random number, a potential hacker has almost no chance of correctly guessing x, even with the help of a powerful computer to conduct millions of trials. • The two users can, therefore, in theory, communicate privately over a public medium with an encryption method of their choice using the decryption key x.
  • 8.
    Summary Diffie-Hellman keyexchange Alice Bob Public Keys available = p, q Public Keys available =p,q Private Key Selected = a Private Key Selected = b Key generated = Key generated = Exchange of generated keys takes place Key received = key received = Generated Secret Key = (b*)^a mod p Generated Secret Key = (a*)^b mod p Users now have a symmetric secret key to encrypt
  • 9.
    Example: • Step 1:Alice and Bob get public numbers p = 23, q = 9 • Step 2: Alice selected a private key a = 4 and • Bob selected a private key b = 3 • Step 3: Alice and Bob compute public values. Find and • Alice: =(9^4 mod 23) = (6561 mod 23) = 6 • Bob: = (9^3 mod 23) = (729 mod 23) = 16 • Step 4: Alice and Bob exchange public numbers • Step 5: Alice receives public key y =16 and • Bob receives public key x = 6 • Step 6: Find the symmetric keys of Alice and Bob • Alice: ^a mod p = 65536 mod 23 = 9 • Bob: a ^b mod p = 216 mod 23 = 9 • Step 7: 9 is the shared secret.
  • 10.
    Example: • Example: Aliceand Bob agree on g =2 and p = 13. • Alice chooses a = 3; this is her private key and Bob chooses b = 7 for his private key. • Find their secret Key. • Sol • Generated Secret Key = (11^3) mod 13= (8^7) mod 13=5
  • 11.
    Example: • Suppose thattwo parties A and B wish to set up a common secret key (D-H key) between themselves using the Diffie Hellman key exchange technique. They agree on 7 as the modulus and 3 as the primitive root. Party A chooses 2 and party B chooses 5 as their respective secrets. Their D-H key is- a) 3 b) 4 c) 5 d) 6
  • 12.
    Example: • Suppose thattwo parties A and B wish to set up a common secret key (D-H key) between themselves using the Diffie Hellman key exchange technique. They agree on 7 as the modulus and 3 as the primitive root. Party A chooses 2 and party B chooses 5 as their respective secrets. Their D-H key is- • 3 • 4 • 5 • 6
  • 13.
    Example: • In aDiffie-Hellman Key Exchange, Alice and Bob have chosen prime value q = 17 and primitive root = 5. If Alice’s secret key is 4 and Bob’s secret key is 6, what is the secret key they exchanged? a) 16 b) 17 c) 18 d) 19
  • 14.
    Example: • In aDiffie-Hellman Key Exchange, Alice and Bob have chosen prime value q = 17 and primitive root = 5. If Alice’s secret key is 4 and Bob’s secret key is 6, what is the secret key they exchanged? a) 16 b) 17 c) 18 d) 19