Skip to content

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

@dan-reznik

Description

@dan-reznik

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions