botan-low-0.0.1.0: Low-level Botan bindings
Copyright(c) Leo D 2023
LicenseBSD-3-Clause
Maintainerleo@apotheca.io
Stabilityexperimental
PortabilityPOSIX
Safe HaskellSafe-Inferred
LanguageHaskell2010

Botan.Low.KeyWrap

Description

NIST specifies two mechanisms for wrapping (encrypting) symmetric keys using another key. The first (and older, more widely supported) method requires the input be a multiple of 8 bytes long. The other allows any length input, though only up to 2**32 bytes.

These algorithms are described in NIST SP 800-38F, and RFCs 3394 and 5649.

These functions take an arbitrary 128-bit block cipher. NIST only allows these functions with AES, but any 128-bit cipher will do and some other implementations (such as in OpenSSL) do also allow other ciphers.

Use AES for best interop.

Documentation

nistKeyWrapEncode Source #

Arguments

:: BlockCipherName

cipher_algo

-> Int

padded

-> ByteString

key[]

-> ByteString

kek[]

-> IO ByteString

wrapped_key[]

nistKeyWrapDecode Source #

Arguments

:: BlockCipherName

cipher_algo

-> Int

padded

-> ByteString

wrapped_key[]

-> ByteString

kek[]

-> IO ByteString

key[]