Score:0

Implementation of Ring Signature

nc flag

I have implemented a ring signature in a Python program, To keep it simple, I have Alice and Bob. Based on this ring equation:

$$ v = E_k(y_s⊕E_k(y_i⊕v))$$

I will get:

$$ y_s = E_k^{-1}(v)⊕E_k(y_i⊕v) \pmod{n_s}$$ where $y_i$ is the private key of the ring signer

However, after calculating, I did not get a value that equals $v$ after completing the ring equation. Given their public keys, $(e_A, n_A)$ and $(e_B, n_B)$ and the Bob private key, in this case, $d_B$ The setup I did was

  1. Hash the message, $H(m) = k$, which will become the key for the symmetrical encryption (AES-128).
  2. Produce a random value, $v$
  3. Produce a random value, $x_A$, where $x_i$ is the random number generated for calculating $y_i$
  4. Compute $y_A = x_A^{e_A} \pmod {n_A}$, where $e_A$ is exponential of the public key, $n_A$ is mod value
  5. Compute $E_k(y_A ⊕ v)$ and $ E_k^{-1}(v)$ , and $XOR$ them to get $y_B$
  6. Since I gotten $y_B$ , I am able to calculate $v$ using the ring equation, where I will have: $$v = E_k(y_B⊕E_k(y_A⊕v))$$

However, my produce $v$ does not match my calculated $v$. Is my implementation for the ring signature wrong?

Let me know if you need more information or see my code, and sorry if I did break any of the rules as it is my second time posting. Cheers!

Maarten Bodewes avatar
in flag
Code review is our thing, but you can post below the current question body it in case nobody sees an error in the equations.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.