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

avoid unneccessary base64 encode of protected data for tag computation #115

Closed
wants to merge 2 commits into from

Conversation

lovesh
Copy link
Contributor

@lovesh lovesh commented Apr 11, 2019

Signed-off-by: lovesh harchandani lovesh.bond@gmail.com

Signed-off-by: lovesh harchandani <lovesh.bond@gmail.com>
3. base64URLencode the `protected` value
4. encrypt the message using libsodium.crypto_aead_chacha20poly1305_ietf_encrypt_detached(message, protected_value_encoded, iv, cek) this is the ciphertext.
3. set `protected` to base64 of the JSON array from step 2.
4. encrypt the message using libsodium.crypto_aead_chacha20poly1305_ietf_encrypt_detached(message, JSON from step 2, iv, cek) this is the ciphertext.
Copy link
Contributor

Choose a reason for hiding this comment

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

If I'm reading this properly, your proposal is to pass the bytes of JSON into the AAD? If so I believe this will make the tag unverifiable because JSON doesn't have deterministically serialize and deserialize, which I believe is necessary for the AAD operation. Am I reading this wrong?

@kdenhartog
Copy link
Contributor

I think this PR should be closed. It moves us away from the JWE standard and I don't believe it garnered enough efficiency worth accepting it. I believe this is why @lovesh closed the PR that referenced this.

@dhh1128
Copy link
Member

dhh1128 commented Jun 2, 2020

This has been superseded by a slightly modified technique that uses out-of-the-box JWE/JWS features.

@dhh1128 dhh1128 closed this Jun 2, 2020
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.

None yet

4 participants