I try to learn ElGamal re-encrypts scheme and I have a question about the example: How is a re-encryption done with elGamal?.

  • The $g$ value of Alice must be the same as $g$ value of Bob or not?
  • And what about of Prime $p$ value for Alice and Bob? Alice.$p$ must be the same as Bob.$p$ or not?


  • 1
    $\begingroup$ Yes, and Yes.${}$ $\endgroup$ – kelalaka Mar 28 at 10:50
  • $\begingroup$ Ok, thank you! I try test it: 2. Bob reencrypts (x,w) as (x′,w′) with x′=xg^u, w′=wy^u(x′)^b. I use BigInteger. I look that x1>0, ok but w1=0, becourse x1 > p: var x1 = g.modPow(u, p).multiply(x); var tmpB = y.modPow(u, p).multiply(w); var w1 = x1.modPow(b,p).multiply(tmpB); this w1 = 0 Where I mistake? – $\endgroup$ – Eugene Mar 29 at 13:40
  • $\begingroup$ Eugene, CryptoSO is not programming site. You can ask your programming question with your programming codes in Stackoverflow. $\endgroup$ – kelalaka Apr 4 at 15:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.