Man in the Middle Attack — the Importance of Authentication
by FOX on 11:50 PM, under Encryption
Since Diffie-Hellman is so great, as long as the prime number Alice and Bob pick is big enough, Their conversation should be safe. Recall the whole process between Alice and Bob on Diffie-Hellman Key Exchange. It’s obvious that all the time, Eve does not say a word, All she does is just listen. What if Eve begins to do something between Alice and Bob?
Recall what Alice and Bod do to implement Diffie-Hellman Key Exchange
- Alice and Bob agree on some prime number p, and a generator g for this prime number.
- Alice picks a value a secretly, and sends Bob A = ga mod p
- Bob picks a value b secretly, and sends Alice B = gb mod p
- Alice receives B, and Computes A’ = Ba mod p
- Bob receives A, and Computes B’ = Ab mop p
Now Eve decides to do these
- Alice and Bob agree on some prime number p, and a generator g for this prime number.
- Eve also gets p and g. She picks b’ and computes B” = gb mod p, then sends it to Alice and says it’s from Bob; on the other hand, she picks a’ and computes A” = ga mod p, then sends it to Bob and say it’s from Alice
- Alice picks a value a secretly, and sends Bob A = ga mod p
- This real A would be ignored by Bob since he receives A” first
- Bob picks a value b secretly, and sends Alice B = gb mod p
- This real B would be ignored by Alice since she receives B” first
- Alice receives B”,she believes it’s from Bob and Computes A’ = B”a mod p
- Bob receives A”, he believes it’s from Alice and Computes B’ = A”b mop p
Know let’s have a look what do they know
Alice: p, g, a, A’, B”
Bob: p, g, b, B’, A”
Eve: p, g, A, B, A’, B’, A”, B”, a’, b’
Alice is gonna use A’ as her secret key and Bob is going to use B’ to encrypt their message,
Now
Alice wants send Bob message m, she encrypts it with A’, sends Bob C, the message cyphered by Alice
Eve and Bob receives C, Bob thinks it’s noise since his B’ doesn’t equal to A’ any more, but Eve can decrypt C to get m by A’, then she will use B’ to encrypt it, and sends Bob C’, the message cyphered by Eve
Bob and Alice receives C’, Alice thinks it’s noise sine her A’ doesn’t equal to A’ any more, but Bob has B’, he will believe it’s from Alice and can decrypt it by B’
Now Eve successfully infiltrates Alice and Bob’s conversation.