SRP (secure remote password)
Implementation based on the RFC5054 specification. See also the SRP description at Wikipedia.
Only SHA-256 is currently supported, others are planned in the future.
Usage
Add the library to your cargo.toml
:
Routines
High-level description of the client-server interaction. An example can also be found from the test case test_srp_client_server.
Client routine
let n = ;
let g = ;
// Create the client
let mut client = new;
// Create public key (A, bigint)
let a = client.step_1;
// Create a client evidence (M1, bigint)
let m_1 = client.step_2;
// Validate server evidence (M2, bigint).
// Note: At this point the client is no longer usable, as it has passed its ownership to the function.
client.step_3
Server routine
let n = ;
let g = ;
// Create server with the public client key A
let mut server = new;
// Create public key B by locating the SRP params for user identity I
let b = server.step_1;
// Validate client evidence M1, and create server evidence M2.
// Note: At this point the server is no longer valid, as it has passed its ownership to the function.
let m_2 = server.step_2;
// If M1 is valid, then from the server's point of view, client is now authenticated