!uucIbqjoOQ
[6 / 1 / ?]

!uucIbqjoOQ No.7617897 ViewReplyReportDelete
Been making some programs using the Diffie-Hellman exchange and what I'm finding is blowing my mind.

From what I understand you need to use a prime as the modulus for this to work. But when I use any number it works. To be honest haven't tried that many but at least 10 different random numbers and it still works.

For example, take the generator 2, and say number 2169 as the mod.

Then take two random numbers, 34, 86.

Now we do:

2^32 mod 2169 = 256.
2^86 mod 2169 = 1201.

1201^32 mod 2169 = 466.
256^86 mod 2169 = 466.

The numbers are still the same even though I didn't use a prime number and generator pair.

Okay I just realised that I got 466 using different numbers last time with the same mod. So anyway please explain. Thanks.