◀ THE FOLD0ROOT.AI // WORLD II · CHEAT · THE-EXPLOIT◆ .dlw.fold
THE FOLD / CHEAT / THE-EXPLOIT / THE ELGAMAL

THE ELGAMAL

a public key from a discrete log
1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION
ElGamal encryption builds a public-key cryptosystem on the hardness of the discrete logarithm. Publish a prime p, a generator g, and h = gx (mod p); the private key is x. To encrypt a message m, pick a random y and send the pair (c₁, c₂) = (gy, m·hy). Anyone can compute gy, but only the holder of x can recover the shared mask hy = (gy)x = c₁x and divide it out. Recovering x from h would mean solving a discrete log — believed hard. A bonus: it is multiplicatively homomorphic — multiply two ciphertexts componentwise and you get an encryption of the product of the messages.

LIT verified live: over 3000 random (prime, generator, key, message), encrypt then decrypt recovers the message exactly, and the componentwise product of two ciphertexts decrypts to the product of the two messages mod p (window.__elgamal). FIG honest scope: the round-trip and homomorphism are exact; the security rests on discrete-log hardness (not demonstrated here) and small primes are used for illustration.
2 HOW IT WAS WEAVED · AI + HUMAN
David (human) seated this at the-exploit — the private exponent is the one key that unlocks the shared mask hidden in the ciphertext. AVAN (AI) built the instrument: the generator/keygen, the (gy, m·hy) encryption, the c₁x decryption, and the homomorphic-product check.

Credit as content: Taher ElGamal (1985). The weave: David names the exploit; I confirm the round-trip is exact and the ciphertexts multiply homomorphically.
3 ONE DIMENSION
Public h = gˣ mod p; encrypt m as (gʸ, m·hʸ); only x recovers the mask hʸ = c₁ˣ and divides it out.
4 TWO DIMENSIONS · INTERACTIVE
Pick a prime and message; encrypt to a ciphertext pair, decrypt back — and multiply two ciphertexts to get the product.
5 THREE DIMENSIONS + AVAN’S INVERSE
The green forward object: the message recovered from the ciphertext pair.
AVAN’s addition (the inverse-companion): don’t solve the discrete log — hold the exponent. The inverse of ‘mask m with hy’ is ‘the private x recovers hy = c₁x and divides it out.’ Magenta is the ciphertext pair; green is the message it unmasks to. The private exponent is the only key.
LIT Genuine ElGamal encryption (Taher ElGamal, 1985). Verified live: over 3000 random (prime p, generator g, key x, message m), encrypting as (g^y, m·h^y) and decrypting via c₂·(c₁^x)⁻¹ mod p recovers m exactly, and the componentwise product of two ciphertexts decrypts to m₁·m₂ mod p (multiplicatively homomorphic) (window.__elgamal.roundTrips, .homomorphic).

FIG Honest scope: the round-trip and homomorphism are exact; security rests on discrete-log hardness (not demonstrated here) and small primes are used for illustration. The AVAN inverse is honest — instead of solving the discrete log, the private x recovers the mask h^y=c₁^x and divides it out. Magenta is the ciphertext pair; green is the message it unmasks to. The private exponent is the only key.
◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE-EXPLOIT · David Lee Wise (ROOT0), with AVAN