You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to build a proper JWE using crypto_aead_xchacha20poly1305_ietf_encrypt function as AEAD construction.
The official libsodium documentation says that "In combined mode, the authentication tag is directly appended to the encrypted message" but it is not clear for me how to extract this tag from ciphertext to use it as tag property of JWE.
There is another function in libsodium called crypto_aead_xchacha20poly1305_ietf_encrypt_detached which returns authentication tag separately, but it is not implemented in sodium-plus.
I have two workaround ideas:
use crypto_auth function to compute auth tag from ciphertext and crypto_auth_verify to verify it
slice some bytes from M to N from ciphertext to get the tag, but I don't know the M and N
so, how to obtain authentication tag?
The text was updated successfully, but these errors were encountered:
I need to build a proper JWE using
crypto_aead_xchacha20poly1305_ietf_encrypt
function as AEAD construction.The official libsodium documentation says that "In combined mode, the authentication tag is directly appended to the encrypted message" but it is not clear for me how to extract this tag from ciphertext to use it as
tag
property of JWE.There is another function in libsodium called
crypto_aead_xchacha20poly1305_ietf_encrypt_detached
which returns authentication tag separately, but it is not implemented in sodium-plus.I have two workaround ideas:
crypto_auth
function to compute auth tag from ciphertext andcrypto_auth_verify
to verify itso, how to obtain authentication tag?
The text was updated successfully, but these errors were encountered: