I'm interested in using a modified form of SRP as a peer-to-peer authentication method. Since neither side is acting as a host, one of the primary design goals for SRP (that the client doesn't need to know anything but an identity and password, so no key management is required) isn't really necessary.
There's a variant of SRP called SRP-Z where the server also has a secret key, and the verifier for that key is public. While this variant is not authorized by the free license from Stanford, I'm not concerned with that here (the patent expires in three years anyway - and I'm not trying to detract from Tom Wu's creation, I think it's absolutely brilliant).
The Secure Remote Password paper and patent describe a generalized Asymmetric Key Exchange formula thus:
$S(R(P(w), P(x)), Q(y, z)) = S(R(P(y), P(z)), Q(w, x))$
for all $w$, $x$, $y$, $z$
and that for SRP:
$P(x) = g^x$
$Q(w, x) = w + ux$
$R(w, x) = wx^u$
$S(w, x) = w^x$
With $w$, $x$ being the user secrets and $y$, $z$ being the server secrets ($w$ and $y$ being the ephemeral values, $x$ the user's password-derived key and $z$ the server's secret key), setting values as SRP does and substituting in (and adding a new value $h$ as the server's public key) you get:
$k = H(N, g)$
$v = g^x$
$h = g^z$
$A = g^w$
$B = g^y$
$AP = A + kh$
$BP = B + kv$
$u = H(AP, BP)$
$S = (Av^u)^{y + uz} = (Bh^u)^{w + ux} = g^{(w + ux)(y + uz)}$
($AP$ and $BP$ are the values sent between client and server, for simplicity I retain $A$ and $B$ as the simple exponential value)
That's the SRP-Z form of the SRP formula, and I haven't really seen anything describing it.
With normal SRP, $z$ = 0 and $h$ = 1, the above reduces to the standard SRP basic key exchange formula:
$S = (Av^u)^y = B^{w + ux} = g^{wy + uxy}$
(since $k$ and $h$ are constant, it is no longer useful to add $kh$ when sending the value of $A$ to the server)
SRP then creates a proof-of-knowledge and specifies that the client sends the proof before the server does (preventing an off-line dictionary attack). The other place where the protocol is not identical on both sides is in the calculation of $u$.
If instead of a single value of $u$, you use two values $t$ and $u$, where
$t = H(AP, BP)$
$u = H(BP, AP)$
$S = (Av^t)^{y + uz} = (Bh^u)^{w + tx} = g^{(w + tx)(y + uz)}$
then the protocol can be handled identically on both sides ($t$ on one side is the same as $u$ on the other).
Proving that both sides have the same value of $S$ is not quite so straightforward, since either side can present the proof first.
Instead of $g^{(w + tx)(y + uz)} = g^{(wy + txy + uzw + tuxz)}$, a different value gives a cleaner way to present the proof:
$U = H(A^y, v^{ty}, A^{uz}) = H(B^w, B^{tx}, h^{uw})$
$V = H(A^y, A^{uz}, v^{ty}) = H(B^w, h^{uw}, B^{tx})$
$S = A^y A^{uz} v^{ty} = B^w B^{tx} h^{uw} = g^{wy + txy + uzw}$
Compare $U$ on one side to $V$ on the other; if they match on both sides, then calculate $S$ and use that to create a key that will be the same on both sides. I believe that the order that the proof is sent is not important.
More concretely, both sides would look like:
For $x$ = private key, $w$ = random session private key, $h$ = other side's verifier
$A = g^w, v = g^x, AP = A + kv$
Other side calculates $B = g^y, h = g^z, BP = B + kh$
Send $AP$ to other side; receive $BP$ from other side
$t = H(AP, BP)$
$u = H(BP, AP)$
$B = BP - kh$
$U = H(B^w, B^{tx}, h^{uw})$
Other side calculates $A = AP - kv, V = H(A^y, A^{uz}, v^{ty})$
Send $U$; receive $V$
Verify $V = H(B^w, h^{uw}, B^{tx})$
Other side verifies $U = H(A^y, v^{ty}, A^{uz})$
If both sides verify then
$K = H(B^w B^{tx} h^{uw})$
Other side calculates $K = H(A^y A^{uz} v^{ty})$
The only disadvantage I see is that this requires one additional modular exponentiation on each side compared to the fully expanded SRP-Z form.
Even though the use I'm thinking of would be using random private keys rather than password-derived keys, which eliminates the need to guard against a dictionary attack against the verifiers, which allows the verifiers on both sides to be public, I've left in those elements of the SRP protocol that help prevent leaking of the verifier.
Does this look practical? Does removing the value $g^{tuxz}$ reduce security over the SRP-Z formula?
Apologies if I've made any mistakes in transcribing the work I've done on this, different variants of the protocol descriptions use different names for the variables (e.g. $a$ and $b$ instead of $w$ and $y$), and I could well have messed up a few.