Phantasm on Nostr: meso Well, the "magic" part of the whole exchange is that when you calculate a power ...
meso (nprofile…gx4l) Well, the "magic" part of the whole exchange is that when you calculate a power of a number that already was a power of something, you can replace it with a something to the power of the two variables multiplied.
pub: g (small prime), n (big prime)
priv: a (alice secret), b (bob secret)
calc:
- alice: g^a modulo n (sent to bob)
- bob: g^b modulo n (sent to alice)
- "magic" part:
- alice: (g^a)^b modulo n; which can be simplified to g^(a * b)
- bob: (g^b)^a modulo n; which can be simplified to g^(b * a)
Now it's obvious that you exchanged a shared secret without disclosing your secrets with a few numbers
These days it's usually done with elliptic curves, but the math still works work almost the same. Instead of powers and modulo, you have an equation for an elliptic curve and multiply a public "position" one of you determined on the curve by your secrets, scrap the Y axis and send the multiplied position (at least that's the way I think it works). Instead of solving the discrete log problem, you are solving the elliptic curve discrete log problem.
pub: g (small prime), n (big prime)
priv: a (alice secret), b (bob secret)
calc:
- alice: g^a modulo n (sent to bob)
- bob: g^b modulo n (sent to alice)
- "magic" part:
- alice: (g^a)^b modulo n; which can be simplified to g^(a * b)
- bob: (g^b)^a modulo n; which can be simplified to g^(b * a)
Now it's obvious that you exchanged a shared secret without disclosing your secrets with a few numbers
These days it's usually done with elliptic curves, but the math still works work almost the same. Instead of powers and modulo, you have an equation for an elliptic curve and multiply a public "position" one of you determined on the curve by your secrets, scrap the Y axis and send the multiplied position (at least that's the way I think it works). Instead of solving the discrete log problem, you are solving the elliptic curve discrete log problem.