A Brief :
Alice and Bob is trying to communicate without wanting Eve (which is listening) to know what they are going to talk about.
So
Bad Eve
|
|
Alice ------------+--------------- Bob
Alice and Bob are publicly agree on a prime modulus and a generator.
Say
- Generator = 3
- Prime = 17
So the formula will be (for example) :
3^x % 17
OK.
Alice is choosing a private number (say 15) and do 3^15 %17 => 6
Bob is choosing a private number (say 13) and do 3^13 %17 => 12
Now Alice and Bob tell each other their results (not their private keys) while Eve is listening.
So now the picture is :
Bad Eve ( knows : 3^x %17 , 12,6)
|
|
Alice ------------+--------------- Bob
(15)private (13)private
12(Bob's) 6(Eve's)
Now Alice takes Bob's 12 and her private key and do :
((other's public num) ^ secret number) % 17
Alice is doing : 12^15 % 17 => 10
Bob is doing : 6^13 % 17 => 10
So now they have the same symmetric number.
Now:
This is an example and it's easy to hack.
All Eve has to do is to try to find which x
in 3^x % 17
would be 15
or 13
.
But Apparently we are talking about big numbers here.
If so - I wrote this demo :
Console.WriteLine(BigInteger.Pow( new BigInteger(3213213213212123332), 6549875) % 17);
Which is :
3213213213212123332 ^ 6549875 % 17
I have I7 with 16gb ram and this run over 5 min
Question :
If both sides ( Alice & Bob) uses big numbers , then it takes a very very long time for them to get a result for the first step ( which later they should exchange that value)
I might be missing something here but it seems that making Eve's life hard by using large numbers , also makes Alice's and Bob's lifes hard.
What am I missing?