Skip to content

feat: CRP-2911 Modify AES-GCM encryption to be more robust#224

Merged
randombit merged 20 commits intomainfrom
jack/crp-2911
Oct 16, 2025
Merged

feat: CRP-2911 Modify AES-GCM encryption to be more robust#224
randombit merged 20 commits intomainfrom
jack/crp-2911

Conversation

@randombit
Copy link
Contributor

Changes include

  • DerivedKeyMaterial is, instead of being just the raw VetKey treated as an HKDF key, is first hashed. This prevents working backwards from a DerivedKeyMaterial to the original VetKey.
  • The user specified domain separator is prefixed with our own specific domain separator
  • The GCM ciphertexts now include an 8 byte header with a version field to allow easier transitions in the future
  • Key derivation takes into account both the user specified domain separator and the ciphertext version
  • Added support for associated data

These changes are not backwards compatible. Backwards compatability could be added in the future if required (eg if the header is unknown, attempt to decrypt using the old scheme - if it works, return the recovered plaintext). The hope is that this is not required.

@randombit randombit requested a review from a team August 19, 2025 23:28
Copy link
Contributor

@fspreiss fspreiss left a comment

Choose a reason for hiding this comment

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

Thanks, @randombit!

@randombit
Copy link
Contributor Author

This is now ready for a new review

Copy link
Contributor

@fspreiss fspreiss left a comment

Choose a reason for hiding this comment

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

Thanks for addressing the comments, @randombit, and for adding the respective changes also in Typescript.

@randombit randombit requested a review from fspreiss October 15, 2025 19:59
Copy link
Contributor

@fspreiss fspreiss left a comment

Choose a reason for hiding this comment

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

Thanks for addressing all the comments, @randombit!

@randombit randombit merged commit a088bb7 into main Oct 16, 2025
12 checks passed
@randombit randombit deleted the jack/crp-2911 branch October 16, 2025 13:01
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.

2 participants