Is it safe to use CTR encryption mode and authenticate it with HMAC(message, key), where key
is the cipher encryption key, and the key is unique for each message? Would it be safer if I change the key a little? For example, flip a lower bit. Or I need to have independent secret for HMAC?
$\begingroup$
$\endgroup$
2
-
$\begingroup$ "Would it be safer if I change the key a little?"; might you mean 'change the IV..." $\endgroup$– ponchoAug 19, 2022 at 17:55
-
$\begingroup$ It's probably safe to use the same key for AES and HMAC because of how distinct the algorithms are. However, it's not recommended and not difficult to just derive two separate keys from the same input keying material/master key using a KDF. $\endgroup$– samuel-lucas6Aug 19, 2022 at 18:35
Add a comment
|