Secure remote password protocol

From Wikipedia, the free encyclopedia

The Secure Remote Password Protocol (SRP) is a password-authenticated key agreement protocol which allows a user to authenticate himself to a server, which is resistant to dictionary attacks mounted by an eavesdropper, and does not require a trusted third party. It effectively conveys a zero-knowledge password proof from the user to the server. Only one password can be guessed at per attempt in revision 6 of the protocol. One of the interesting properties of the protocol is that even if one or two of the cryptographic primitives it uses are attacked, it is still secure. The SRP protocol has been revised several times, and is currently at revision six.

The SRP protocol creates a large private key shared between the two parties in a manner similar to Diffie-Hellman, then verifies to both parties that the two keys are identical and that both sides have the user's password. In cases where encrypted communications as well as authentication are required, the SRP protocol is more secure than the alternate SSH protocol and faster than using Diffie-Hellman with signed messages. It is also independent of third parties, unlike Kerberos. The SRP protocol, version 3 is described in RFC 2945. SRP version 6 is also used for strong password authentication in SSL/TLS and other standards such as EAP and SAML, and is being standardized in IEEE P1363 and ISO/IEC 11770-4.


In this description of the protocol, version 6,

  • N and q = (N-1)/2 are both prime (N is a safe prime and q is a Sophie Germain prime). All arithmetic is performed modulo N.
  • g is a generator of the multiplicative group modulo N,
  • k is a parameter derived by both sides, for example k = H(N, g).
  • s is a small salt,
  • I is a username,
  • p is the user's password,
  • H() is a hash function, e.g. SHA-256
  • v is the host's password verifier, v = gx, x = H(s,p)
  • u, a and b are random.
  • and | denotes concatenation


All other variables are defined in terms of these. First to establish a password p with Steve, Carol picks a small random salt s, and computes x = H(s, p),
v = gx. Steve stores v and s, indexed by I, as Carol's password verifier and salt. x is discarded because it is equivalent to the plaintext password p. This step is completed before the system is used.

  • Carol -> Steve: I | A ,with A = ga
  • Steve -> Carol: s | B, with B = kv + gb
  • Both: u = H(A, B)
  • Carol: SCarol = (B - kgx)(a + ux)
  • Carol: KCarol = H(S)
  • Steve: SSteve = (Avu)b
  • Steve: KSteve = 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 is:

  • Carol -> Steve: M1 = H(H(N) XOR H(g) | H(I) | s | A | B | KCarol). Steve verifies M1.
  • Steve -> Carol: M2 = H(A | M | KSteve). Carol verifies M2.


This method requires guessing more of the shared state to be successful in impersonation than just the key. While most of the additional state is public, private information could safely be added to the inputs to the hash function, like the server private key. The two parties also employ the following safeguards:
1. Carol will abort if she receives B == 0 (mod N) or u == 0.
2. Steve will abort if he receives A == 0 (mod N).
3. Carol must show her proof of K first. If Steve detects that Carol's proof is incorrect, he must abort without showing its own proof of K.

[edit] External links

[edit] See also

Password-authenticated key agreement

Public-key cryptography
v  d  e
Algorithms: Cramer-Shoup | DH | DSA | ECDH | ECDSA | EKE | ElGamal | GMR | IES | Lamport | MQV | NTRUEncrypt | NTRUSign | Paillier | Rabin | Rabin-Williams | RSA | Schnorr | SPEKE | SRP | XTR
Theory: Discrete logarithm | Elliptic curve cryptography | RSA problem
Standardization: ANS X9F1 | CRYPTREC | IEEE P1363 | NESSIE | NSA Suite B   Misc: Digital signature | Fingerprint | PKI | Web of trust | Key size
Cryptography
v  d  e
History of cryptography | Cryptanalysis | Cryptography portal | Topics in cryptography
Symmetric-key algorithm | Block cipher | Stream cipher | Public-key cryptography | Cryptographic hash function | Message authentication code | Random numbers