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

wouldn't data_tag() be more appropriate for authenticating _encrypted_ messages? #8

Open
dan-reznik opened this issue Sep 25, 2018 · 0 comments

Comments

@dan-reznik
Copy link

dan-reznik commented Sep 25, 2018

hi jeroen, on sodium's vignette you talk about how data tagging can be used to authenticate a key,message pair, e.g.:

key <- hash(charToRaw("This is a secret passphrase"))
msg <- serialize(iris, NULL)
mytag <- data_tag(msg, key)

however, since data is often times transmitted/stored in encrypted format, i would think this function's more typical use would be to tag (msg_cipher,key) or even (msg_cipher,key_cipher) pair, e.g.:

key <- hash(charToRaw("This is a secret passphrase"))
msg <- serialize(iris, NULL)
nonce <- random(24)
msg_cipher <- data_encrypt(msg, key, nonce)
mytag <- data_tag(msg_cipher, key) # or even my_tag <- data_tag(msg_cipher, key_cipher)

am i missing something?

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

No branches or pull requests

1 participant