Elgamal
Today, I learned about elgamal encryption. It was.... fun, to say the
least. It's an interesting algorithm, but also somewhat... weird?
Idk.
Elgamal
- Public parameters
where the latter is a primitive root of the former and the former is a
prime number.
- Key generation works in a similar way, get a
and raise the primitive root to that power, calling it
and publishing all three as the public key.
- Encryption happens as follows: Calculate
,
,
,
and transmit
to the recipient.
- Decryption happens as follows: Take
and raise it to
and then use it's modular inverse and multiply with
.
The idea is fairly straightforward. Basically give the signer
something that we can raise using our own base and that'll give us
whatever he had, to invert it and use it.
here is a nonce here, obviously.