SecureRemotePassword::Helpers
Instance methods
calculate_A(a : BigInt) : BigInt
Calculate the client's public value A = g^a % N where param 'a' is a random number at least 256 bits in length
calculate_B(b : BigInt, v : BigInt) : BigInt
Calculate the server's public value B B = g^b + k v (mod N)
calculate_client_S(arg_B : BigInt, salt : String, uu : BigInt, a : BigInt) : BigInt
Client secret S = (B - (k * g^x)) ^ (a + (u * x)) % N
calculate_M(username : String, salt : String, xaa, xbb, xkk) : BigInt
M = H(H(N) xor H(g), H(I), s, A, B, K) NOTE:: overwrite what is hashed here if your implementation differs
calculate_server_S(arg_A : BigInt, v : BigInt, u : BigInt, arg_b : BigInt) : BigInt
Server secret S = (A * v^u) ^ b % N
calculate_u(arg_A, arg_B) : BigInt
Calculate u = SHA1(PAD(A) | PAD(B)), which serves to prevent an attacker who learns a user's verifier from being able to authenticate as that user.
calculate_x(salt : String, username : String = @username, password : String = @password)
Calculate x = SHA1(s | SHA1(I | ":" | P))
hash(h : Bytes | String) : BigInt
Sourcehash_hex(bytes : Bytes) : String
Sourcehash_hex(h : String) : String
Sourcehash_string(string : String) : String
Sourceinitialization_value(group : Int) : Tuple(BigInt, BigInt)
Sourceno_padding_hash(*a) : BigInt
Sourcepadded_hash(*parts) : BigInt
Sourcerandom_big_int(bytes : Int) : BigInt
Sourcerandom_hex(bytes : Int) : String
Source