Class: SRP

SRP~ SRP

SRP

new SRP()

Secure Remote Password Protocol (RFC 2945) Version 6 JavaScript Implementation
Source:

Methods

computeA() → {BigInteger}

compute A
Source:
Returns:
A
Type
BigInteger

computeB() → {BigInteger}

compute B
Source:
Returns:
B
Type
BigInteger

computeClientK() → {string}

compute client K, requires A and B
Source:
Returns:
K
Type
string

computeHash(s) → {string}

compute hash, may be overridden if needed
Parameters:
Name Type Description
s string (string to hash)
Source:
Returns:
hash
Type
string

computeM1() → {string}

compute M1, requires A, B, I, K and s
Source:
Returns:
M1
Type
string

computeM2() → {string}

compute M2, requires A, K and M1
Source:
Returns:
M2
Type
string

computePasswordHash(s, p) → {string}

compute password hash, may be overriden if needed
Parameters:
Name Type Description
s string (salt)
p string (password)
Source:
Returns:
hash
Type
string

computeRandom() → {BigInteger}

compute random, may be overridden if needed
Source:
To Do:
  • add more entropy
Throws:
Will throw an error if not enough entropy is available.
Returns:
random
Type
BigInteger

computeServerK() → {string}

compute server K, requires A and B
Source:
Returns:
K
Type
string

computeVerifier() → {BigInteger}

compute verifier, requires p and s
Source:
Returns:
verifier
Type
BigInteger

init()

Initialize with default N and g. May be overwritten with own N and g, where N must be a large safe prime and g an appropriate generator.
Source:

test()

Run a full test with example password and salt. Client K and Server K will match if successful. Results will be printed to console.
Source:

verifyA() → {boolean}

verify A
Source:
Returns:
result
Type
boolean

verifyB() → {boolean}

verify B
Source:
Returns:
result
Type
boolean

verifyHAB() → {boolean}

verify HAB
Source:
Returns:
result
Type
boolean

verifyK() → {boolean}

verify K, returns true if client K and server K match
Source:
Returns:
result
Type
boolean