View Source rfc3394 (rfc3394 v1.0.0)

Implementation of Advanced Encryption Standard (AES) Key Wrap Algorithm as defined in https://datatracker.ietf.org/doc/html/rfc3394.html.

Summary

Functions

unwrap Ciphertext with KEK and check KeyData integrity with default initial value (IV)

unwrap Ciphertext with KEK and check KeyData integrity with IV

wrap KeyData with KEK and default initial value (IV)

wrap KeyData with KEK and IV

Functions

-spec unwrap(Ciphertext :: binary(), KEK :: binary()) -> KeyData :: binary().

unwrap Ciphertext with KEK and check KeyData integrity with default initial value (IV)

Ciphertext is a binard of at least 24 bytes, byte_size(Ciphertext) must be divisible by 8.

KEK is a 128 bit or 192 bit or 256 bit AES key (binary).

the resulting KeyData 8 smaller than Ciphertext

Will raise an exception of class error wht reason iv_mismatch if the integrity check fails.

Link to this function

unwrap(Ciphertext, KEK, IV)

View Source
-spec unwrap(Ciphertext :: binary(), KEK :: binary(), IV :: binary()) -> KeyData :: binary().

unwrap Ciphertext with KEK and check KeyData integrity with IV

Ciphertext is a binardf of at least 24 bytes, byte_size(Ciphertext) must be divisible by 8.

KEK is a 128 bit or 192 bit or 256 bit AES key (binary).

IV is a 8 byte binary.

the resulting KeyData 8 smaller than Ciphertext

Will raise an exception of class error wht reason iv_mismatch if the integrity check fails.

see: https://datatracker.ietf.org/doc/html/rfc3394.txt#section-2.2.2 and https://datatracker.ietf.org/doc/html/rfc3394.txt#section-2.2.3

-spec wrap(KeyData :: binary(), KEK :: binary()) -> Ciphertext :: binary().

wrap KeyData with KEK and default initial value (IV)

KeyData is a binary of at least 16 bytes,byte_size(KeyData) must be divisible by 8.

KEK is a 128 bit or 192 bit or 256 bit AES key (binary).

the resulting Ciphertext 8 bytes larger than KeyData

-spec wrap(KeyData :: binary(), KEK :: binary(), IV :: binary()) -> Ciphertext :: binary().

wrap KeyData with KEK and IV

KeyData is a binary of at least 16 bytes,byte_size(KeyData) must be divisible by 8.

KEK is a 128 bit or 192 bit or 256 bit binary.

IV is a 8 byte binary.

the resulting Ciphertext 8 bytes larger than KeyData

see: https://datatracker.ietf.org/doc/html/rfc3394.txt#section-2.2.1