1
$\begingroup$

In SRP, the server stores the client verifier $v$, defined as $v=g^x \operatorname{mod}N$. $x$ is an implementation-defined value derived from the user's password $p$ and salt $s$ (and often other values, such as the username $I$).

The RFC2945-defined method to derive $x$ is $x=H(s \|H(I\|\text{":"}\|p))$. $H$ is suggested as SHA-1 and often also implemented as SHA-256. That means that in the usual case, $x$ is a 160-bit or 256-bit value.

$x$ is effectively password-equivalent, so knowing it (and the associated $I$ and $s$) would allow an attacker to impersonate the user, for example in the case of a leaked $v$.

My question here is: assuming a dictionary attack on $g$ isn't the biggest threat1, does it weaken the security of the protocol that $x\ll N$? Mainly, does it make the discrete logarithm problem on $g^x$ easier to solve? This would be easy to mitigate by using a longer hash or extendable-output function for $x$.

1 i.e., $p$ has lots of entropy and $x$ is computed using a slow hash

$\endgroup$

1 Answer 1

3
$\begingroup$

does it weaken the security of the protocol that $x\ll N$?

Not really.

There are essentially two ways to try to attack this system:

  • Perform a discrete log based on partial information on x. If the attacker knows that $0 < x < 2^k$, then he can recover $x$ in $O(2^{k/2})$ time (using a generic technique such a Pollard Rho or Giant-Step-Baby-Step)

  • Perform a discrete log using Number Field Sieve (NFS); the complexity of this depends on N and not at all on $x$. For an $N \approx 2^{3072}$, this takes about $2^{128}$ operations.

Combining these two observations, we see that we want an $x$ circa $2^{256}$; a consistently smaller $x$ will reduce security, while selecting $x$ from a larger random will not increase security (because of NFS).

And, larger $x$ values do have a cost (because it becomes more computationally complex for the honest user), hence we have a decent justification for a 256 bit $x$ (which is what SHA-256 gives us)

$\endgroup$
4
  • $\begingroup$ "Of course, the attacker does not know this." – that's my point here. The standard use case uses a 160- or 256-bit hash value for x, which, if I'm not mistaken, means x << N ≈ 2^4095. $\endgroup$ Commented Dec 5 at 19:15
  • $\begingroup$ @PurkkaKoodari: oops, I misread the question. I've updated the answer to actually address your question. $\endgroup$
    – poncho
    Commented Dec 5 at 19:56
  • $\begingroup$ Thanks! So while 256-bit x is adequate for a 3072 bit group, I guess there is then a theoretically significant difference with a 160-bit x for 2048/3072 bit groups, and even with 256-bit x for, say, a 8192-bit group? (Eyeballing the graph here - of course 3072-bit NFS isn't feasible in any practical sense) $\endgroup$ Commented Dec 5 at 20:44
  • 2
    $\begingroup$ @PurkkaKoodari: yes; a 160 bit x would have circa $2^{80}$ security, which might have been appropriate when SRP we first designed, but is considered too weak nowadays. As for a 8192 bit group, I personally consider that a bit silly - I expect a CRQC (cryptographically relevent quantum computer) to be available before a classical computer could break a 3072 bit discrete log (and for a CRQC, a 8192 bit group is only somewhat harder than a 3072 bit group) $\endgroup$
    – poncho
    Commented Dec 5 at 21:12

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.