pakery-spake2plus
SPAKE2+ augmented PAKE protocol implementation (RFC 9383).
Part of the pakery workspace.
SPAKE2+ is an augmented (asymmetric) PAKE: the server stores a verifier derived from the password rather than the password itself. It provides mutual explicit key confirmation with provable security.
Usage
[]
= "0.1"
= { = "0.1", = ["ristretto255"] }
Example
use ;
use ;
use ;
use Hash;
;
let mut rng = OsRng;
// Derive password scalars (w0, w1)
let h0 = digest;
let w0 = scalar_from_wide_bytes.unwrap;
let h1 = digest;
let w1 = scalar_from_wide_bytes.unwrap;
// Server stores the verifier L = w1 * G
let l_bytes = ;
// Prover (client) starts
let = start.unwrap;
// Verifier (server) starts and produces confirmation
let = start.unwrap;
// Prover finishes and verifies server's confirmation
let prover_out = prover_state.finish.unwrap;
// Verifier finishes and verifies prover's confirmation
let verifier_out = verifier_state.finish.unwrap;
// Session keys match
assert_eq!;
Features
| Feature | Description |
|---|---|
std (default) |
Enable std support |
getrandom |
Enable OS-backed RNG via rand_core/getrandom |
test-utils |
Expose deterministic constructors for testing |
Security
#![forbid(unsafe_code)]- Constant-time comparisons via
subtle - Secret values zeroized on drop via
zeroize - Validated against RFC 9383 test vectors
MSRV
The minimum supported Rust version is 1.79.
License
Licensed under either of Apache License, Version 2.0 or MIT License at your option.