0
$\begingroup$

In RFC5054, the SRP6a algorithm states that the client and the server should generate random ephemeral private values $a$ and $b$ respectively which are used for further derivation in the handshake and in the generation of the shared-key. For a persistent TLS connection, it obviously makes sense to generate a new random $b$ value each time a client connects.

Edited for clarity: However, I would like to use SRP in a stateless authentication handshake over multiple HTTP requests. The first request would be the client sending its $I$ to the server, and it would receive ($N$, $g$, $s$, $B$) in return. The client would the calculate $A$ and make another request to confirm its identity. Since the second request may hit a different server, this implies that the private $b$ would have to be shared across all servers. The simple solution is a constant value shared by all servers.

Aside from replayability, does choosing a random but constant $b$ value across all servers have any other security implications? Should I definitely not do this? Would silly tricks, like a varying time-windowed values derived from a constant $b$ be a better choice?

My instinct tells me this is roughly fine, in the same way that we use random-but-constant secrets to secure, e.g. session cookies, but I want to understand the implications.

To be clear, I'm only using this for authentication purposes so that the server never sees the user's password, and depending on TLS for forward secrecy of subsequent communications. I realize I could also, for example, bcrypt the user's password before sending it to the server to achieve similar goals, but thought it might be better to use a degraded version SRP instead.

$\endgroup$

2 Answers 2

2
$\begingroup$

If you use a $g^b$ value between sessions, you allow an attacker to test multiple passwords for the second session; this invalidates the security goal for SRP.

Here is how the attack looks like:

For the first session, the attacker logs in using a password he does know. The server sends the value $B = kv + g^b$; the attacker knows $k$ (that's derived from common data), he knows $v$ (that's derived from the password he knows), and so can recover $g^b$

For the second session, the attacker listens into a login that uses a password he does not know. Again, the server sends the value $B = k'v' + g^b$ (where $k', v'$ are different values for this session), as he now knows $g^b$ (and can derive $k'$, he can recover $v'$; he can then go through his dictionary, and test the various passwords against $v'$.

$\endgroup$
0
0
$\begingroup$

Why $b$ has to be a constant value? REST API? I think you can pack $g^b$ with rest message and client side first recovers $g^b$ and this should be fine

$\endgroup$
2
  • $\begingroup$ I don't quite understand. b is my secret exponent, and my public value is therefore B = k*v + g^b % N. For SRP, b is supposedly random and ephemeral, but unless I coordinate state across servers, b will need to be random but constant. (E.g., server X generates b and sends B to client, client processes and replies with A, but instead is load-balanced to server Y which cannot verify because it doesn't know b). $\endgroup$
    – twooster
    Commented Nov 1, 2017 at 23:02
  • $\begingroup$ @twooster yes. b should be ephemeral, so same session should be balanced to same server. Similar case like TLS also need to deal with this kind of problem $\endgroup$
    – 9f241e21
    Commented Nov 2, 2017 at 0:01

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.