-
Notifications
You must be signed in to change notification settings - Fork 293
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
API support for AAD? #169
Comments
Unfortunately, NaCl doesn't have a defined AEAD construction, only AE (XSalsa20Poly1305). You can try ChaCha20Poly1305 AEAD (e.g. @stablelib/chacha20poly1305), but note that its nonce is short (12 bytes), so you may want XChaChaPoly https://download.libsodium.org/doc/secret-key_cryptography/aead/chacha20-poly1305 if using a random nonce. Sometimes, for short headers people just include a copy of them in the encrypted data, and then compare them after decryption with the attached plain-text headers, but this is riskier and I don't think would work very well for JWE. |
Is it possible to add an API that supports the use of authenticated additional data? We're looking to implement JWEs based on this library, but the use of the protected header is making it not possible. What would be the best approach to handle this?
The text was updated successfully, but these errors were encountered: