psalami / HKDF

HMAC-based Extract-and-Expand Key Derivation Function (HKDF) in Swift

Home Page:http://boukehaarsma.nl/HKDF

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HKDF in Swift

HKDF is an HMAC based key derivation function that transforms any weak key material into cryptographically strong key material. It can be used, for example, to convert a session key derived in a secure remote password authentication into key material suitable for use in encryption, integrity checking or authentication.

Build Status

Usage:

// Input Key Material (ikm): weak input key material.
let ikm = Data(bytes: try! Random.generate(byteCount: 16))

// Output Key Material (okm): strong key material.
let okm = deriveKey(algorithm: .sha256, seed: ikm, count: 32)

More information can be found in the documentation.

References:

Credits

This library was written by Bouke Haarsma.

About

HMAC-based Extract-and-Expand Key Derivation Function (HKDF) in Swift

http://boukehaarsma.nl/HKDF

License:MIT License


Languages

Language:Swift 100.0%