diff --git a/SRP Design.md b/SRP Design.md index 5dce605..2820964 100644 --- a/SRP Design.md +++ b/SRP Design.md @@ -11,6 +11,7 @@ their shortcomings. The following is a description of SRP-6 and 6a, the latest versions of SRP: +``` N A large safe prime (N = 2q+1, where q is prime) All arithmetic is done modulo N. g A generator modulo N @@ -25,17 +26,20 @@ The following is a description of SRP-6 and 6a, the latest versions of SRP: A,B Public ephemeral values x Private key (derived from p and s) v Password verifier +``` The host stores passwords using the following formula: +``` x = H(s, p) (s is chosen randomly) v = g^x (computes password verifier) +``` The host then keeps {I, s, v} in its password database. The authentication protocol itself goes as follows: - +``` User -> Host: I, A = g^a (identifies self, a = random number) Host -> User: s, B = kv + g^b (sends salt, b = random number) @@ -47,16 +51,16 @@ Host -> User: s, B = kv + g^b (sends salt, b = random number) Host: S = (Av^u) ^ b (computes session key) Host: K = H(S) - +``` Now the two parties have a shared, strong session key K. To complete authentication, they need to prove to each other that their keys match. One possible way: - +``` User -> Host: M = H(H(N) xor H(g), H(I), s, A, B, K) Host -> User: H(A, M, K) - +``` The two parties also employ the following safeguards: