|
Bouncy Castle Cryptography Library 1.81 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.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 | |
protected java.math.BigInteger |
a
|
protected java.math.BigInteger |
A
|
protected java.math.BigInteger |
B
|
protected Digest |
digest
|
protected java.math.BigInteger |
g
|
protected java.math.BigInteger |
Key
|
protected java.math.BigInteger |
M1
|
protected java.math.BigInteger |
M2
|
protected java.math.BigInteger |
N
|
protected java.security.SecureRandom |
random
|
protected java.math.BigInteger |
S
|
protected java.math.BigInteger |
u
|
protected java.math.BigInteger |
x
|
Constructor Summary | |
SRP6Client()
|
Method Summary | |
java.math.BigInteger |
calculateClientEvidenceMessage()
Computes the client evidence message M1 using the previously received values. |
java.math.BigInteger |
calculateSecret(java.math.BigInteger serverB)
Generates the secret S given the server's credentials |
java.math.BigInteger |
calculateSessionKey()
Computes the final session key as a result of the SRP successful mutual authentication To be called after verifying the server evidence message M2. |
java.math.BigInteger |
generateClientCredentials(byte[] salt,
byte[] identity,
byte[] password)
Generates client's credentials given the client's salt, identity and password |
void |
init(java.math.BigInteger N,
java.math.BigInteger g,
Digest digest,
java.security.SecureRandom random)
Initialises the client to begin new authentication attempt |
void |
init(SRP6GroupParameters group,
Digest digest,
java.security.SecureRandom random)
|
protected java.math.BigInteger |
selectPrivateValue()
|
boolean |
verifyServerEvidenceMessage(java.math.BigInteger serverM2)
Authenticates the server evidence message M2 received and saves it only if correct. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.math.BigInteger N
protected java.math.BigInteger g
protected java.math.BigInteger a
protected java.math.BigInteger A
protected java.math.BigInteger B
protected java.math.BigInteger x
protected java.math.BigInteger u
protected java.math.BigInteger S
protected java.math.BigInteger M1
protected java.math.BigInteger M2
protected java.math.BigInteger Key
protected Digest digest
protected java.security.SecureRandom random
Constructor Detail |
public SRP6Client()
Method Detail |
public void init(java.math.BigInteger N, java.math.BigInteger g, Digest digest, java.security.SecureRandom random)
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 generationpublic void init(SRP6GroupParameters group, Digest digest, java.security.SecureRandom random)
public java.math.BigInteger generateClientCredentials(byte[] salt, byte[] identity, byte[] password)
salt
- The salt used in the client's verifier.identity
- The user's identity (eg. username)password
- The user's password
public java.math.BigInteger calculateSecret(java.math.BigInteger serverB) throws CryptoException
serverB
- The server's credentials
CryptoException
- If server's credentials are invalidprotected java.math.BigInteger selectPrivateValue()
public java.math.BigInteger calculateClientEvidenceMessage() throws CryptoException
CryptoException
public boolean verifyServerEvidenceMessage(java.math.BigInteger serverM2) throws CryptoException
serverM2
- the server side generated evidence message
CryptoException
public java.math.BigInteger calculateSessionKey() throws CryptoException
CryptoException
|
Bouncy Castle Cryptography Library 1.81 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |