Rabin signature is rightly celebrated as a signature scheme with provable reduction to factorization. How do we show that for Rabin-Williams signature as standardized, under the common and realistic hypothesis that the adversary has access to a signature oracle?
I'll describe in detail the standardized modular arithmetic in Rabin-Williams signature, per ISO/IEC 9796-2:2010 appendix B, or almost equivalently ISO/IEC 14888-2:2008 RW or IEEE P1363-2000 IFSP-RW/IFVP-RW¹. I assume signature with appendix per Full Domain Hash because I don't want to dive into padding and message recovery, but the reasoning also applies to deterministic paddings in these standards.
Security parameter $k$ is the public modulus size in bits. For the padding, we assume a hash function $H_k:\{0,1\}^*\to\{0,1\}^{k-5}$ with result assimilated to an integer in $[0,2^{k-5})$, and that this hash is undistinguishable from a Random Oracle.
Key generation $\mathsf{Gen}$: on input $1^k$
- draw random primes $p,q\in[2^{(k-1)/2},2^{k/2}]$ with $p\equiv3\pmod8$ and $q\equiv7\pmod8$, which turns out to be possible $\forall k>10$
- compute $n\gets p\,q$, which is exactly $k$-bit
- set $e\gets2$ and compute $d\gets e^{-1}\bmod(\operatorname{lcm}(p-1,q-1)/2)$
- output $\mathrm{Pub}=(n,e)$ and $\mathrm{Priv}=(n,d)$.
Signature $\mathsf{Sign}$: on input $\mathrm{Priv}=(n,d)$ and message $M$
- compute $k\gets\left\lceil\,\log_2(n)\right\rceil$
- compute message representative $m\gets16\,H_k(M)+12$ [with thus $m\in[0,2^{k-1})$ and $m\equiv12\pmod{16}$ ]
- compute² the Jacobi symbol $j\gets\left(\frac m n\right)$
- compute $g\gets\begin{cases}m/2&\text{if }\,j=-1\\m&\text{otherwise}\end{cases}\quad$[with thus $\left(\frac g n\right)\ge0$ ]
- compute $r\gets g^d\bmod n$
- compute and output the signature $s\gets\min(r,n-r)$.
Verification $\mathsf{Ver}$: on input $\mathrm{Pub}=(n,e)$, message $M$ and signature $s$
- set $k\gets\left\lceil\,\log_2(n)\right\rceil$
- compute message representative $m\gets16\,H_k(M)+12$ [with thus $m\in[0,2^{k-1})$ and $m\equiv12\pmod{16}$ ]
- if $s\not\in[0,(n+1)/2)$ then output $\mathtt{Invalid}$ and stop
- compute $t\gets s^e\bmod n$ and $u\gets t\bmod8$
- if $u\not\in\{1,4,6,7\}$ then output $\mathtt{Invalid}$ and stop
- set $v\gets\begin{cases}t&\text{if }\,u=4\\n-t&\text{if }\,u=1\\ 2\,t&\text{if }\,u=6\\2\,(n-t)&\text{if }\,u=7\end{cases}$
- if $m\ne v$ then output $\mathtt{Invalid}$ and stop
- output $\mathtt{Valid}$.
Soundness can be proved using that for all $x\in\mathbb Z,\,x^2\equiv{\left({\left(x^2\right)}^d\right)}^e\pmod n$.
The values of $u$ allowed at $\mathsf{Ver}_5$ and cases at $\mathsf{Ver}_6$ correspond to $m\equiv12\pmod{16}$ after $\mathsf{Sign}_2$ and $\mathsf{Ver}_2$, per this table (where for large $k$ it's impossible in practice to find $M$ that triggers any of the four right cases):
$$\begin{array}{c|rrrr|rrrr} \left(\frac m p\right)&+1&-1&-1&+1&+1& 0&-1& 0\\ \left(\frac m q\right)&+1&-1&+1&-1& 0&+1& 0&-1\\ \hline \left(\frac m n\right)&+1&+1&-1&-1& 0& 0& 0& 0\\ u & 4& 1& 6& 7& 4& 4& 1& 1 \end{array}$$
Observation: adversaries with access to signatures of known arbitrary messages can compute $u\gets (s^e\bmod n)\bmod 8$, thus deduce $\left(\frac m p\right)$ and $\left(\frac m q\right)$ for known pseudo-random $m\equiv12\pmod{16}$. When without access to these signatures I only see they could get at the lesser information $\left(\frac m n\right)=\left(\frac m p\right)\,\left(\frac m q\right)$.
Questions [please ignore 1 and 3, I got them solved!]
Is there an argument that the above observation can't give an adversary with access to signatures (or a signature oracle) some insight on the factorization of $n$?- How do we prove that this Rabin-Williams signature is sEF-CMA (Strongly secure against Existential Forgery under Chosen-Message Attack), assuming factorization of $n$ as output by $\mathsf{Gen}$ is hard?
Are these reductions to factorization all towards the security of the scheme, or do they somewhat go against it (leaving out side-channels and other implementation-specific attacks)? My concern is that existential break with signature oracle ⟹ factorization ⟹ total break is not intuitively reassuring.
Update: perhaps the answer to 2 is in Bernstein's Proving tight security for Rabin-Williams signatures, originally in proceedings of Eurocrypt 2008, but I have a hard time following that paper³, or even ascertain the question's scheme is his α-|principal| with B=0 (thus fixed).
¹ IEEE P1363-2000 cites ISO/IEC 9796:1991 and Hugh C. Williams' A modification of the RSA public-key encryption procedure (in IEEE TIT, 1980) as it's origin. ISO/IEC 9796:1991 uses $m\equiv6\pmod{16}$ at $\mathsf{Sign}_2$ and $\mathsf{Ver}_2$, which requires minor adjustments at $\mathsf{Ver}_5$ and $\mathsf{Ver}_6$, see the Handbook of Applied Cryptography's Modified-Rabin signature scheme (starting page marked 439 following 11.27).
² One can compute $j\gets\left(\frac m n\right)$ per algorithm 2.149 in the Handbook of Applied Cryptography. Bernstein gives a method avoiding Jacobi symbols by making $p$ and $q$ part of the private key, reusing computations needed when using the Chinese Reminder Theorem to speed-up private-key operation, and other optimizations using precomputed values.
³ And I respectfully disagree on one count: the motivation of the $\min$ step in $\mathsf{Sign}_6$ is stated as:
the point is that ($s$) takes a bit less space than ($r$)
but that's missing another objective: having sEF-CMA rather than EF-CMA, by allowing the check in $\mathsf{Ver}_3$, which prevent an adversary from changing $s$ into an equally valid signature $n-s$, which would break sEF-CMA.