module SecureRemotePassword::Helpers
Direct including types
Defined in:
secure-remote-password/helpers.crInstance Method Summary
-
#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_h_amk(xaa, xmm, xkk)
H(A, M, K) for final client validation
-
#calculate_k : BigInt
Calculate k = H(N || g), which is used throughout various SRP calculations.
-
#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_v(username : String, password : String, salt : String) : BigInt
verifier version
-
#calculate_v(salt : String) : BigInt
Calculate v = g^x % N
-
#calculate_x(salt : String, username : String = @username, password : String = @password)
Calculate x = SHA1(s | SHA1(I | ":" | P))
- #hash(h : Bytes | String) : BigInt
- #hash_hex(bytes : Bytes) : String
- #hash_hex(h : String) : String
- #hash_string(string : String) : String
- #initialization_value(group : Int) : Tuple(BigInt, BigInt)
-
#modpow(a : BigInt, n : BigInt, m : BigInt) : BigInt
a^n (mod m)
- #no_padding_hash(*a) : BigInt
- #padded_hash(*parts) : BigInt
- #random_big_int(bytes : Int) : BigInt
- #random_hex(bytes : Int) : String
Instance Method Detail
Calculate the client's public value A = g^a % N where param 'a' is a random number at least 256 bits in length
Calculate the server's public value B B = g^b + k v (mod N)
Client secret S = (B - (k * g^x)) ^ (a + (u * x)) % N
Calculate k = H(N || g), which is used throughout various SRP calculations.
M = H(H(N) xor H(g), H(I), s, A, B, K)
NOTE : overwrite what is hashed here if your implementation differs
Server secret S = (A * v^u) ^ b % N
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 = SHA1(s | SHA1(I | ":" | P))