|
|
p = 337 g = 227 n = 100 m = 55 p = 337 g = 227 n = 100 m = 55 |
Nikita sends ng and Michael sends mg:
n*g = 121 m*g = 16 n*g = 121 m*g = 16 |
The "secret" key is nmg = n\cdot (mg) = m\cdot (ng):
252 252 |
However, anybody can instantly compute nmg, given what was sent over the wire (which was mg, ng, and g):
Time: CPU 0.00 s, Wall: 0.00 s 468738878288630638333358888551939639945207222683730397638051244680545455\ 777888529310307256529162138999494148015688505639157400137730563812590764\ 913935653800123896188353517549614438265333812008584504780941160691082437\ 618146393002310529125415544153229608069065803026175300082278212392339175\ 8153522866 Time: CPU 0.00 s, Wall: 0.00 s 4687388782886306383333588885519396399452072226837303976380512446805454557778885293103072565291621389994941480156885056391574001377305638125907649139356538001238961883535175496144382653338120085845047809411606910824376181463930023105291254155441532296080690658030261753000822782123923391758153522866 |
|
|
p = 337 g = 227 n = 100 m = 55 CPU time: 0.01 s, Wall time: 0.01 s p = 337 g = 227 n = 100 m = 55 CPU time: 0.01 s, Wall time: 0.01 s |
Nikita and Michael agree on g and p in public, then Nikita sends g^n and Michael sends g^m, where we view g as a number mod p:
g^n = 253 g^m = 41 g^n = 253 g^m = 41 |
The "secret" key is g^{nm} = (g^m)^n = (g^n)^m:
Michael computes secret: 158 Michael computes secret: 158 |
Nikita computes secret: 158 Nikita computes secret: 158 |
And it appears that nobody else can easily compute g^{nm}, given what was sent over the wire, since finding n from g^n and g seems very, very hard in general. This hard problem is called the discrete log problem.
|
|
Click to the left again to hide and once more to show the dynamic interactive window |
|
|
|
|
Click to the left again to hide and once more to show the dynamic interactive window |
|
|