#key-derivation #kdf #nist #shared-secret #secret-key #shared-key

no-std concat-kdf

Concatenation Key Derivation Function (Concat KDF)

1 unstable release

0.1.0 Mar 27, 2022

#2747 in Cryptography

Download history 4102/week @ 2024-07-23 4832/week @ 2024-07-30 4815/week @ 2024-08-06 4574/week @ 2024-08-13 5263/week @ 2024-08-20 4434/week @ 2024-08-27 5614/week @ 2024-09-03 5421/week @ 2024-09-10 6502/week @ 2024-09-17 7318/week @ 2024-09-24 6875/week @ 2024-10-01 9687/week @ 2024-10-08 10128/week @ 2024-10-15 12260/week @ 2024-10-22 8521/week @ 2024-10-29 8242/week @ 2024-11-05

41,260 downloads per month
Used in clevis

MIT/Apache

8KB
63 lines

RustCrypto: Concat KDF

crate Docs Apache2/MIT licensed Rust Version Project Chat Build Status

Pure Rust implementation of the Concatenation Key Derivation Function (Concat KDF) generic over hash function. This function is described in the section 5.8.1 of NIST SP 800-56A, Recommendation for Pair-Wise Key Establishment Schemes Using Discrete Logarithm Cryptography.

Usage

The most common way to use Concat KDF is as follows: you generate a shared secret with other party (e.g. via Diffie-Hellman algorithm) and use key derivation function to derive a shared key.

let mut key = [0u8; 32];
concat_kdf::derive_key_into::<sha2::Sha256>(b"shared-secret", b"other-info", &mut key).unwrap();

Dependencies

~335KB