You are on page 1of 14

Diffie-Hellman KEY Exchange

Algorithm
( Information Security )
Rajdeep S. Shaktwat

CIPHERS
Process defining ENCRYPTION and

DECRYPTION
STREAM CIPHER : BIT by BIT encryption and
decryption
BLOCK CIPHER : BLOCK by BLOCK
encryption and decryption

STREAM CIPHER EXAMPLE

BLOCK CIPHER EXAMPLE

Two kinds of
Cryptography
SYMMETRIC

1) Alice and Bob agree


on a cryptosystem
2) Alice and Bob agree
on a key
3) Alice takes her
plaintext message
and encrypts it using
the encryption
algorithm and the
key. This creates a
ciphertext message
4) Alice sends the
ciphertext message
to Bob
5) Bob decrypts the
ciphertext message
with the same
algorithm and key
and reads it

ASYMMETRIC

1) Alice and Bob agree


on a public-key
cryptosystem
2) Bob sends Alice his
public key
3) Alice encrypts her
message using Bobs
public key and sends
it to Bob
4) Bob decrypts Alices
message using his
private key
5) EX : RSA
6) High Computation
cost

SYMMETRIC KEY
CRYPTOGRAPHY

ASYMMETRIC KEY
CRYPTOGRAPHY

MATRIX OF KEYS

Diffie-Hellman KEY Exchange


Algorithm
Designed for Key Exchange
Used for two parties agree on a SYMMETRIC

KEY.
Algo is for key exchange not for Encryption
and Decryption.
What's interesting about this algorithm is
that neither user actually gets to choose
the key. But, at the end of the algorithm,
both users have calculated the same key

Algorithm Diffie Helman


Key EX.
They need to
Communicate by SKC
with XYZ ALGO
Which Require a KEY
for encryption and
decryption. HOW to
EXCHANGE KEY OVER
INSECURE
COMMUNICATION
CHANNEL. Diffie
Hellman is the
solution

Firstly Alice and Bob agree on two large Prime

numbers n and g. ( INSECURE ).


Alice chooses large random number X and
calculates
A=gxmod n
Alice sends A to bob.
Bob chooses random number Y and caluclates
B=gy mod n , Bob sends B to Alice
Alice Computes key k1 = Bx mod n
Bob Computes key k2 = Ay mod n
At END k1 = k2 = k

Example
Let n = 11 and g =7 ( agree on insecure channel )
Alice chooses random number X=3 computes

A=73 mod 11
343 mod 11 = 2
Alice send 2 to bob
Bob chooses random number Y = 6
Computes B = 7 6 mod 11 , 117649 mod 11 = 4
Bob sends 4 to alice
Alice computes : k1 = 43 mod 11 , 64 mod 11 = 9
Bob computes : k2 : 2 6 mod 11 , 64 mod 11 = 9
Hence k1 comes out EQUAL to k2

Man in the MIDDLE ATTACK/ Bucket


brigade Attack
ALICE

BOB
n=11 g=7
n=11 g=7
X=3
y=9
A: 2
B =8
A sends 2
B sends 8

4 from B
A : 4 3 mod 11

TOM(A)
n=11 g=7
x=8 , y=6
A=9 , B= 4
INTERCEPTS

TOM (A) 9 from A


k1 : 8 8 mod 11

You might also like