1

I'm trying to wrap my head around the concept of SIV in the context of encryption. I understand the aspect of nonce misuse, etc. And I understand that the key feature for SIV is that they ensure that while encrypting the same message with the same key will reveal that it is identical, it will not reveal anything else.

In particular, using the same key on different messages will not have the catastrophic issue with nonce reuse in other system.

If I understand correctly, you can build a SIV mode of operation using:

def encrypt(msg, key):
   siv = hash_shake256(bits=192, msg)
   return xchacha20(key, siv, msg), siv

In other words, we first compute a keyed hash on the message, then use that value as the nonce for the actual encryption.

The output is the cipher text as well as the generated siv, both of them are safe to share without revealing anything to an adversary.

The security comes from the keyed hash function non reversible nature and the fact that for each msg we pass as input, we are ensured that we won't have a duplicate nonce.

  • Am I understanding things correctly?
  • Is it safe to use the same key for both keyed hash and encryption?
  • I assume actual siv usage is a bit more than just hashing the input?

1 Answers1

1

Am I understanding things correctly?

SIV requires MAC, not just hash. Keyed hash can be used as MAC. However, you do not have a keyed hash in your example (but you do say keyed hash).

Is it safe to use the same key for both keyed hash and encryption?

Generally different key should be used for MAC and encryption. Although in some cases it may be fine with same key, if MAC and encryption are different enough. For example, if you use CBC-MAC and CTR both with AES, using same key is bad. SIV mode defines how you derive the keys from master key.

I assume actual siv usage is a bit more than just hashing the input?

Well, again you have to use MAC. You should check actual SIV variant for more details. For example SIV with AES (CMAC and CTR): https://datatracker.ietf.org/doc/html/rfc5297

LightBit
  • 1,649
  • 13
  • 27