Skip to main content
6 of 6
Correct capitalization and order, and other small fixes
fgrieu
  • 141.7k
  • 12
  • 310
  • 594

1-out-of-2 Oblivious Transfer with RSA

I'm trying to implement a simple 1-out-of-2 Oblivious Transfer with RSA. I was checking the code and tried to work it step by step. The 2 messages by Alice, let's say, are $m_0 = 7$ and $m_1 = 9$. Bob's decryption turns out to be -8. Can you please help me understand what I'm doing incorrectly? Am I missing $\bmod N$ somewhere?

  • $m_0 = 7$, $m_1 = 9$
  • $p: 3$, $q: 5$, $\phi: 8$, $N: 15$
  • coprime $e: 3$
  • $d: 3$
  • Public and private keys: $(3, 15)$
  • $X_0, X_1: 8, 5$
  • Bob's choice: $b=0$, random $k: 22$
  • $x_b: 8$
  • $v = (8+22^3) \bmod 15 = 6$
  • $v: 6$, $k_0: (6-8)^3 \bmod 15 = 7$, $k_1: (6-5)^3 \bmod 15 = 1$
  • $m_0+k_0: 7+7= 14=M_0$
  • $m_1+k_1: 9+1= 10=M_1$
  • $M_b: 14$
  • Bob decrypts: Chosen Message: $17-22 = -8$
Guest
  • 21
  • 2