ElGamal Encryption Calculator
Enter a prime p, generator g, private key x, ephemeral key k, and message m.
Result
How to use
- Enter your values in the fields above.
- Press Calculate to see your result instantly.
- Use the Share button to copy a link to your result.
About this calculator
The ElGamal cryptosystem, published by Taher Elgamal in 1985, is a public-key encryption scheme whose security rests on the discrete logarithm problem in a finite cyclic group — given a prime p and generator g, it's computationally hard to recover x from y = g^x mod p. Key generation picks a private key x and publishes y = g^x mod p as the public key; encryption then draws a fresh random ephemeral key k for every message and produces a ciphertext pair (c₁, c₂) = (g^k mod p, m·y^k mod p), so the same plaintext never encrypts to the same ciphertext twice.
This calculator walks through that math step by step: enter a small prime p, generator g, private key x, ephemeral key k, and an integer message m, and it derives the public key and the resulting ciphertext pair exactly as the algorithm would. Cryptography students, computer science instructors, and security engineers use toy examples like this to build intuition for asymmetric encryption and for the discrete-log basis that also underlies Diffie-Hellman key exchange and the DSA signature scheme — real deployments use primes hundreds of digits long, far beyond hand or calculator arithmetic.
Was this helpful?
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
No calculators found
Comments (0)