0
$\begingroup$

I am trying to do some ElGamal encryption but having a different encryption formula. For that I doing the following steps:

The key generator:

  1. Choosing value $p = 107$ and $a = 2$
  2. Random number $d = 67$, and $b = a^d \bmod p$ where $b = 2^{67} \bmod 107 = 94$
  3. $k_{priv} = 67$ and $k_{pub} = (p,a,b) = (107,2,94)$

Encryption

  1. Random value $v = 45$ and $C_1 = a^v \bmod p = 2^{45} \bmod 107 = 28$
  2. We have the message $m = 66$; $C_2 = m \cdot b^v \cdot a^v \bmod 107 = 66 \cdot 94^{45} \cdot 2^{45} \bmod 107 = 38$
  3. Finally, $C = (C_1, C_2)$

My problem comes when I try to decrypt the message, maybe I am totally wrong. But I am doing:

$C_1 = a^v$
$C_2 = m \cdot a^v \cdot (a^d)^v$ $C_2 = m \cdot C_1 \cdot (a^d)^v$

I trying to do that is where I am a little bit lost. If someone can help me with a clue to decrypt the message I would be nice

$\endgroup$
11
  • $\begingroup$ What is the source of this question? $\endgroup$
    – kelalaka
    Oct 28, 2020 at 18:10
  • $\begingroup$ You forgot to use the $d$, it is your secret, right? $\endgroup$
    – kelalaka
    Oct 28, 2020 at 19:35
  • $\begingroup$ my question is how i can decrypt the message. I not sure if my approach is the best $\endgroup$ Oct 29, 2020 at 8:32
  • $\begingroup$ I'm assuming this is homework question there we only provide hints. Since you show some effort I'll direct you. Use the fact that $b=a^d$ since the message sent to you and $d$ is your secret. $\endgroup$
    – kelalaka
    Oct 29, 2020 at 9:57
  • $\begingroup$ Thanks, this helped me. I didn't solved yet. I don't know how to solve the $(a^d)^v$ $\endgroup$ Oct 30, 2020 at 19:34

1 Answer 1

1
$\begingroup$

Finally, the decryption is: $m = C_2 \cdot C_1^{-1} \cdot C_1^{-d}$

$\endgroup$
1
  • 1
    $\begingroup$ That was easy, right? Now accept and close. have fun! $\endgroup$
    – kelalaka
    Oct 30, 2020 at 21:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.