# The security of an encrypt-and-MAC

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$).

-
Very closely related: crypto.stackexchange.com/questions/202/… –  hunter Aug 29 '13 at 14:41
@hunter: related to that other question, but different since keys are not reused, and thus with a different answer. This is fine in theory, but utterly impractical as anything involving the One-Time-Pad, and anything assuming not reusing a MAC key (here k2) without a definition of how new keys are established. –  fgrieu Aug 29 '13 at 17:12
@fgrieu : $\;\;\;$ This needs HMAC to be a secure privacy-preserving MAC. $\:$ (I'm aware that that would follow from certain properties of the compression function, but it's a stronger assumption than HMAC just being a secure MAC.) $\:$ A better option is to use an unconditionally secure MAC in the encrypt-then-MAC approach. –  Ricky Demer Aug 29 '13 at 18:11
Does not respond to my question: in the construction above (my example), and about the security of plaintext (is it affected by the encrypt-and-MAC ?). I know that the latter can (only) provide the integrity of plaintext contrarily to the encrypt-then-MAC. Roughly speaking, Can we said that in the example above the confidentiality and integrity of "data" are provided (Of course, with considering the keys updates) –  zof Aug 29 '13 at 19:28
This seems very similar to this recent question. The only real difference I can see is that the other question explicitly specifies that k1 = RC4(k2). –  Ilmari Karonen Aug 29 '13 at 22:00

His construction will in fact satisfy INT-CTXT, since the one-time pad has the property that different ciphertexts decrypt to different plaintexts. $\:$ Also, "is a computationally secure privacy-preserving MAC" implies "is a computationally secure MAC". $\;\;\;$ –  Ricky Demer Aug 29 '13 at 21:35