Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aead::stream: improved STREAM initialization with key derivation #1306

Open
tarcieri opened this issue Apr 20, 2023 · 0 comments
Open

aead::stream: improved STREAM initialization with key derivation #1306

tarcieri opened this issue Apr 20, 2023 · 0 comments
Labels
aead Authenticated Encryption with Associated Data (AEAD) crate

Comments

@tarcieri
Copy link
Member

Currently the Encryptor and Decryptor accept an explicit nonce, which is 64-bit or 56-bit when used with IETF AEADs that use 96-bit nonces. This is too small to safely expose a generate_nonce function which generates a random nonce, but we also don't provide any additional tools for helping simplify STREAM setup.

Google's Tink library uses HKDF to derive a unique key per STREAM from the combination of some input key material and a STREAM-specific nonce (notably also generating random nonces for you).

This paper analyzes Tink's construction and suggests more parsimonious constructions which can e.g. reuse symmetric encryption primitives rather than using HKDF: https://eprint.iacr.org/2020/1019.pdf

We should probably adopt one or more of these approaches for simplifying STREAM setup. The tink-streaming-aead crate could provide some inspiration, and if we do go with HKDF, ideally it would be implemented in a Tink-compatible manner where that crate could leverage our upstream implementation.

@tarcieri tarcieri added the aead Authenticated Encryption with Associated Data (AEAD) crate label Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aead Authenticated Encryption with Associated Data (AEAD) crate
Projects
None yet
Development

No branches or pull requests

2 participants
@tarcieri and others