AEADChaCha20Poly1305 encrypt with associated_data #952
GreenSnakeLinux
started this conversation in
General
Replies: 1 comment
-
|
It's missing API to do so. The schema is AEAD however we don't expose any API to attach data to it. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
In Python there is the following class in cryptography\hazmat\primitives\ciphers\aead.py
class ChaCha20Poly1305:
def encrypt(
self,
nonce: bytes,
data: bytes,
associated_data: typing.Optional[bytes],
) -> bytes:
It takes an additional parameter: associated_data that is not present in your swift implementation:
let encrypt = try AEADChaCha20Poly1305.encrypt(plaintext, key: key, iv: nonce, authenticationHeader: header)
(It's not authenticationHeader, my test indicate that only the last 16 bytes are impacted)
Is it a miss in the implementation or there is a way to do the same as Python ?
thanks
Beta Was this translation helpful? Give feedback.
All reactions