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
- Hash the message, $H(m) = k$, which will become the key for the symmetrical encryption (AES-128).
- Produce a random value, $v$
- Produce a random value, $x_A$, where $x_i$ is the random number generated for calculating $y_i$
- Compute $y_A = x_A^{e_A} \pmod {n_A}$, where $e_A$ is exponential of the public key, $n_A$ is mod value
- Compute $E_k(y_A ⊕ v)$ and $ E_k^{-1}(v)$ , and $XOR$ them to get $y_B$
- 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!