Class SRP6Client
java.lang.Object
org.gudy.bouncycastle.crypto.agreement.srp.SRP6Client
Implements the client side SRP-6a protocol. Note that this class is stateful, and therefore NOT threadsafe.
This implementation of SRP is based on the optimized message sequence put forth by Thomas Wu in the paper
"SRP-6: Improvements and Refinements to the Secure Remote Password Protocol, 2002"
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BigIntegerprotected BigIntegerprotected BigIntegerprotected Digestprotected BigIntegerprotected BigIntegerprotected SecureRandomprotected BigIntegerprotected BigIntegerprotected BigInteger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate BigIntegercalculateSecret(BigInteger serverB) Generates client's verification message given the server's credentialsgenerateClientCredentials(byte[] salt, byte[] identity, byte[] password) Generates client's credentials given the client's salt, identity and passwordvoidinit(BigInteger N, BigInteger g, Digest digest, SecureRandom random) Initialises the client to begin new authentication attemptprotected BigInteger
-
Field Details
-
N
-
g
-
a
-
A
-
B
-
x
-
u
-
S
-
digest
-
random
-
-
Constructor Details
-
SRP6Client
public SRP6Client()
-
-
Method Details
-
init
Initialises the client to begin new authentication attempt- Parameters:
N- The safe prime associated with the client's verifierg- The group parameter associated with the client's verifierdigest- The digest algorithm associated with the client's verifierrandom- For key generation
-
generateClientCredentials
Generates client's credentials given the client's salt, identity and password- Parameters:
salt- The salt used in the client's verifier.identity- The user's identity (eg. username)password- The user's password- Returns:
- Client's public value to send to server
-
calculateSecret
Generates client's verification message given the server's credentials- Parameters:
serverB- The server's credentials- Returns:
- Client's verification message for the server
- Throws:
CryptoException- If server's credentials are invalid
-
selectPrivateValue
-
calculateS
-