by phoenixking6931 » 09 May 2021, 02:25
There is a way for you and your partner to create a shared key without anyone else figuring it out.
This is how it works, to my knowledge. You and your friend choose two large prime numbers, n and g - these are public and anyone can see them. You and your friend secretly choose large numbers a and b respectively - these are sent to nobody.
You calculate g^a mod n (raise g to the power a and take the remainder when divided by n) and your friend calculates g^b mod n. You send g^a and g^b to each other. There is no way to use g and g^a to solve for a in any reasonable amount of time.
Finally, you calculate (g^b)^a mod n and your friend calculates (g^a)^b mod n. But (g^b)^a = (g^a)^b = g^(ab), so g^(ab) is a shared secret between you two. This is the key used to encrypt messages.
a and b are called "private keys" since they are known only to their owners, and g^a and g^b are called "public keys" since they are known to everyone.
With the help of offline software used to encrypt / decrypt messages with keys, this is totally doable over PP.