#key-derivation #private-key #ecdsa #key-gen #seed #fips #key-generation #p256

det-keygen

Derivation of ECDSA private keys from arbitrary seeds, using FIPS 186-5 methods only

1 unstable release

Uses new Rust 2024

0.1.0 Jul 3, 2025

#1865 in Cryptography

Download history 7/week @ 2025-07-09 1/week @ 2025-07-16 106/week @ 2025-09-03 165/week @ 2025-09-10 189/week @ 2025-09-17 370/week @ 2025-09-24 396/week @ 2025-10-01 282/week @ 2025-10-08 172/week @ 2025-10-15 143/week @ 2025-10-22

1,111 downloads per month

Custom license

15KB
165 lines

det-keygen

This crate implements an experimental port of the Python reference implementation of C2SP's ECDSA Deterministic Key Generation.

This specification enables the derivation of ECDSA private keys from arbitrary seeds (using FIPS 186-5 methods only) which should contain at least 192 bits of entropy.

Examples

// Generate a P-256 private key based on a 160-bit seed

use det_keygen::{Keygen, P256};

let seed = b"When in doubt, don't";

let keygen = Keygen::<P256>::new(seed);
let key = keygen.generate();

ECDSA Deterministic Key Generation

This is an experimental port of the Python reference implementation of C2SP's ECDSA Deterministic Key Generation. This specification enables the derivation of ECDSA private keys from arbitrary seeds (using FIPS 186-5 methods only) which should contain at least 192 bits of entropy.

Currently this crate does only support P256, not P-224, P-384, or P-521 (which are also covered by the specification).

Usage:

let keygen = Keygen::<P256>::new(&seed);
let key = keygen.generate();

Dependencies

~6–17MB
~269K SLoC