public class

SRP6Client

extends Object
java.lang.Object
   ↳ org.bouncycastle.crypto.agreement.srp.SRP6Client

Class Overview

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"

Summary

Fields
protected BigInteger A
protected BigInteger B
protected BigInteger N
protected BigInteger S
protected BigInteger a
protected Digest digest
protected BigInteger g
protected SecureRandom random
protected BigInteger u
protected BigInteger x
Public Constructors
SRP6Client()
Public Methods
BigInteger calculateSecret(BigInteger serverB)
Generates client's verification message given the server's credentials
BigInteger generateClientCredentials(byte[] salt, byte[] identity, byte[] password)
Generates client's credentials given the client's salt, identity and password
void init(BigInteger N, BigInteger g, Digest digest, SecureRandom random)
Initialises the client to begin new authentication attempt
Protected Methods
BigInteger selectPrivateValue()
[Expand]
Inherited Methods
From class java.lang.Object

Fields

protected BigInteger A

protected BigInteger B

protected BigInteger N

protected BigInteger S

protected BigInteger a

protected Digest digest

protected BigInteger g

protected SecureRandom random

protected BigInteger u

protected BigInteger x

Public Constructors

public SRP6Client ()

Public Methods

public BigInteger calculateSecret (BigInteger serverB)

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

public BigInteger generateClientCredentials (byte[] salt, byte[] identity, byte[] password)

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

public void init (BigInteger N, BigInteger g, Digest digest, SecureRandom random)

Initialises the client to begin new authentication attempt

Parameters
N The safe prime associated with the client's verifier
g The group parameter associated with the client's verifier
digest The digest algorithm associated with the client's verifier
random For key generation

Protected Methods

protected BigInteger selectPrivateValue ()