Comprehensive ElGamal public-key cryptosystem simulation with detailed mathematical steps. Work with numbers only to understand discrete logarithm problems and modular arithmetic.
Given y = g^x mod p, finding x is computationally hard
Given g^x mod p and g^k mod p, finding g^(xk) mod p is hard
Same message produces different ciphertexts due to random k
Ciphertext reveals no information about plaintext