RustCrypto / RustCrypto/AEADs

aead-stream: improved STREAM initialization with key derivation

Open
#731 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
961
Forks
200
Avg merge
1h 30m
Merged PRs (30d)
6

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the Encryptor and Decryptor nonce handling, then compare the proposed STREAM setup approaches in the linked paper with the tink-streaming-aead crate. Determine which construction should be adopted and whether HKDF compatibility is required; done means the project has an agreed, implementable design for safer STREAM initialization.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cryptography
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.