Skip to Content
oxcrypto

Key wrapping

Encrypt key material under a key-encryption key.

wrap(kek, key) returns the wrapped key and unwrap(kek, wrapped) returns the key. If the integrity check fails, unwrap raises oxcrypto.InvalidTag and returns nothing.

The key-wrap crates are written to zeroize their expanded keys on drop (oxcrypto has not verified this independently), and oxcrypto zeroizes the unwrapped key buffer it owns. The bytes objects returned to Python are not wiped; see zeroization.