2

I would like to know what is the security of an encrypt-and-MAC with different keys for each transaction

For example: the one-time-pad with $k_1$ and the HMAC with $k_2$

$$C = M \oplus k_1\\ MAC = HMAC(k_2,M)$$

The ciphertext is $C||MAC$. The two keys $k_1$ and $k_2$ change for each transaction (for each $M$).

CodesInChaos
  • 25,121
  • 2
  • 90
  • 129
zof
  • 409
  • 1
  • 5
  • 13

1 Answers1

3

The answer to this question follows directly from the answers to Should we MAC-then-encrypt or encrypt-then-MAC? and the comment thread here. In short: Your scheme is computationally secure (IND-CCA2 and INT-CTXT) assuming that HMAC is a computationally secure privacy-preserving MAC; but your scheme is wildly impractical, as fgrieu explains, so it is not very interesting from a practical perspective. In addition, this is far from the best possible construction.

If you want advice on what construction to use, I suggest you ask a new question specifying your requirements and let folks suggest a construction. In practice standard schemes for authenticated encryption should suffice for almost all real-world situations.

D.W.
  • 36,982
  • 13
  • 107
  • 196