Botan

SRP-6a (RFC 5054 compatatible)

License
Botan is released under the Simplified BSD License (see LICENSE.md)

SRP6KeyPair  srp6ClientAgree(in string identifier, in string password, in string group_id, in string hash_id, ref const Vector!ubyte salt, ref const BigInt B, RandomNumberGenerator rng);

SRP6a Client side

Parameters
string identifier the username we are attempting login for
string password the password we are attempting to use
string group_id specifies the shared SRP group
string hash_id specifies a secure hash function
Vector!ubyte salt is the salt value sent by the server
BigInt B is the server's public value
RandomNumberGenerator rng is a random number generator
Returns
(A,K) the client public key and the shared secret key

BigInt  generateSrp6Verifier(in string identifier, in string password, ref const Vector!ubyte salt, in string group_id, in string hash_id);

Generate a new SRP-6 verifier

Parameters
string identifier a username or other client identifier
string password the secret used to authenticate user
Vector!ubyte salt a randomly chosen value, at least 128 bits long
string group_id specifies the shared SRP group
string hash_id specifies a secure hash function

string  srp6GroupIdentifier(ref const BigInt N, ref const BigInt g);

Return the group id for this SRP param set, or else thrown an exception

Parameters
BigInt N the group modulus
BigInt g the group generator
Returns
group identifier

Represents a SRP-6a server session


ref const(BigInt)  step1(ref const BigInt v, in string group_id, in string hash_id, RandomNumberGenerator rng);

Server side step 1

Parameters
BigInt v the verification value saved from client registration
string group_id the SRP group id
string hash_id the SRP hash in use
RandomNumberGenerator rng a random number generator
Returns
SRP-6 B value

SymmetricKey  step2()(auto ref const BigInt A);

Server side step 2

Parameters
BigInt A the client's value
Returns
shared symmetric key