cryptographycmacmessage-authentication-code

CMAC why K1 and K2


http://en.wikipedia.org/wiki/CMAC

http://www.rfc-archive.org/getrfc.php?rfc=4493

There are two keys K1 and K2. Are there any other reasons, beside that messages 1 differs from 10^127 (1 and 127 zeroes)

If message carries length (and length is also CMAC-ed whit message), are there any security weaknesses using only one randomly generated K?


Solution

  • I don't believe it has to do with known-plaintext attacks, and I disagree with symmetric ciphers are susceptible to them. One of the conditions of a cipher being secure is that it is secure under KPA, CPA (chosen-plaintext attacks) and CCA (chosen-ciphertext attacks).

    Unless I am not understanding your question, yes, you still need both subkeys. K2 is used when a block is not a complete block. . K1 and K2 are not randomly generated, but are derived from K. Is there a reason you do not want to generate these subkeys?

    There are a number of weaknesses in authentication codes based on chaining modes. CBC-MAC was provably secure only for fixed size messages. The security completely fails for variable length messages where the last block is padded.

    You can read the XCBC paper to see how the attack works:

    "As a simple example, notice that given the CBC MAC of a one-block message X, say T = CBCEK(X), the adversary immediately knows the CBC MAC for the two-block message X || (X ^ T) since this is once again T."

    [1] http://www.cs.ucdavis.edu/~rogaway/papers/3k.pdf