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

Add support to Transit, keysutil for XChaCha20-Poly1305 #36

Merged
merged 1 commit into from
Feb 12, 2024

Conversation

cipherboy
Copy link
Member

@cipherboy cipherboy commented Jan 6, 2024

This adds support for XChaCha20-Poly1305, a variant of ChaCha20-Poly1305 with double the nonce size (12->24). Due to the construction of most AEAD cipher modes which lack a synthetic IV (mostly this and GCM), nonce reuse becomes problematic. A small default nonce size (96 bits) results in only 96/2 = 2^48 message encryptions before reuse becomes likely due to the birthday paradox. As a result, NIST has mandated 2^32 as the upper limit on AES-GCM encryption operations in FIPS to keep the threshold sufficiently small. This necessitates key rotation when the limit is reached.

By using a larger nonce (24-bytes), key rotation can be avoided.

Resolves: #35

cc: @DemiMarie


This can be tested by rebasing on top of my prune-extra-plugins branch (to fix the build & most tests) and running go test github.com/openbao/openbao/builtin/logical/transit to avoid hitting issues discussed on matrix.

cipherboy pushed a commit to cipherboy/openbao that referenced this pull request Jan 21, 2024
@cipherboy cipherboy force-pushed the transit-support-xchacha20 branch 2 times, most recently from b06bb72 to e5a9490 Compare February 5, 2024 15:30
@naphelps naphelps self-requested a review February 5, 2024 15:34
@naphelps naphelps added this to the Alpha milestone Feb 7, 2024
This adds support for XChaCha20-Poly1305, a variant of ChaCha20-Poly1305
with double the nonce size (12->24). Due to the construction of most AEAD
cipher modes which lack a synthetic IV (mostly this and GCM), nonce
reuse becomes problematic. A small default nonce size (96 bits) results
in only 96/2 = 2^48 message encryptions before reuse becomes likely
due to the birthday paradox. As a result, NIST has mandated 2^32 as the
upper limit on AES-GCM encryption operations in FIPS to keep the
threshold sufficiently small. This necessitates key rotation when the
limit is reached.

By using a larger nonce (24-bytes), key rotation can be avoided.

Resolves: openbao#35

Signed-off-by: Alexander Scheel <alexander.m.scheel@gmail.com>
Copy link
Member

@JanMa JanMa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm 👍

@naphelps naphelps merged commit a730916 into openbao:main Feb 12, 2024
5 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RFE - XChaCha20 support
4 participants