CBC-MAC

CBC-MAC

In cryptography, a Cipher Block Chaining Message Authentication Code, abbreviated CBC-MAC, is a technique for constructing a message authentication code from a block cipher. The message is encrypted with some block cipher algorithm in CBC mode to create a chain of blocks such that each block depends on the proper encryption of the block before it. This interdependence ensures that a change to any of the plaintext bits will cause the final encrypted block to change in a way that cannot be predicted or counteracted without knowing the key to the block cipher.

To calculate the CBC-MAC of message m one encrypts m in CBC mode with zero initialization vector. The following figure sketches the computation of the CBC-MAC of a message comprising blocks m_1|m_2|cdots|m_x using a secret key k and a block cipher E:

Variable-length messages

Given a secure block cipher, CBC-MAC is secure for fixed-length messages. However, by itself, it is not secure for variable-length messages.An attacker who knows the correct message-tag pairs (m, t) and (m', t') can generate a third message m" whose CBC-MAC will also be t'. This is simply done by XORing the first block of m' with t and then concatenating m with this modified m', i.e. by making m" = m | [(m_1' oplus t) | m_2' | dots | m_x'] .

This problem cannot be solved by adding a message-size block (e.g., with Merkle-Damgård strengthening) and thus it is recommended to use a different mode of operation, for example, CMAC to protect integrity of variable-length messages.

Using the same key for encryption and authentication

One common mistake is to reuse the same key k for CBC encryption and CBC-MAC. Although a reuse of a key for different purposes is a bad practice in general, in this particular case the mistake leads to a spectacular attack. Suppose that one encrypts a message m_0 | m_1 | cdots | m_{x-1} in the CBC mode using an IV c_{-1} and gets the following ciphertext: c_0 | c_1 | cdots | c_{x-1}, where c_i = E_k(m_i oplus c_{i-1}). He also generates the CBC-MAC tag for the IV and the message: t=M(m_{-1} | cdots | m_{x-1}). Now an attacker can change every bit before the last block c_{x-1} and the MAC tag still be valid. The reason is that t = E_k(m_{x-1} oplus c_{x-2}) = c_{x-1} (this is actually the reason why people make this mistake so often—it allows to increase the performance by a factor of two). Hence as far as the last block is not changed the equivalence t = c_{x-1} holds and thus the CBC-MAC tag is correct.

This example also shows that a CBC-MAC cannot be used as a collision resistant one-way function: given a key it is trivial to create a different message which “hashes” to the same tag.

ee also

* CMAC — A block-cipher–based MAC algorithm which is secure for messages of different lengths (recommended by NIST).
* OMAC and PMAC — Other methods to turn block ciphers into message authentication codes (MACs).
* One-way compression function - Hash functions are often based on block ciphers. But note, there is a slight difference in function and purpose between MACs (such as CBC-MAC) and hashes.
* DAA — A (now obsolete) U.S. government standard instantiation of CBC-MAC.

References

# [http://www.iso.org/iso/en/CatalogueDetailPage.CatalogueDetail?CSNUMBER=31136&ICS1=35&ICS2=40&ICS3= ISO/IEC 9797-2:2002]
# [http://www.cs.ucdavis.edu/research/tech-reports/1997/CSE-97-15.pdf The security of the cipher block chaining message authentication code.]


Wikimedia Foundation. 2010.

Игры ⚽ Поможем сделать НИР

Look at other dictionaries:

  • CBC-MAC — В криптографии, CBC MAC является технологией построения аутенфикационного кода сообщения из блочного шифра. Сообщение шифруется при помощи некоторого блочного алгоритма шифрования в режиме CBC, для создания цепочки блоков с правилом  каждый… …   Википедия

  • CBC-MAC — Schema du CBC MAC CBC MAC est l un des algorithmes de MAC. Il est basé sur un chiffrement par bloc utilisé selon un mode d opération CBC (cipher block chaining). Ce principe a été formulé en 1985 dans un standard du NIST (FIPS PUB 113, Standard… …   Wikipédia en Français

  • Counter-Mode/CBC-Mac protocol — En cryptologie, CCMP (Counter Mode/CBC Mac protocol) est une méthode de chiffrement définie dans le standard IEEE 802.11i. CCMP gère les clés et l intégrité des messages. Il s agit d une alternative considérée comme plus sûre que TKIP qui est… …   Wikipédia en Français

  • CBC (cryptographie) — Mode d opération (cryptographie) En cryptographie, un mode d opération est la manière de traiter les blocs de texte clairs et chiffrés au sein d un algorithme de chiffrement par bloc. Chacun des modes possède ses propres atouts. Plusieurs modes… …   Wikipédia en Français

  • One-key MAC — OMAC (One key MAC) is a message authentication code constructed from a block cipher much like the PMAC algorithm. Officially there are two OMAC algorithms (OMAC1 and OMAC2) which are both essentially the same except for a small tweak. OMAC1 is… …   Wikipedia

  • The Challengers (CBC TV film) — Infobox Film name = The Challengers image size = 200px caption = VHS cover director = Eric Till producer = Ralph Endersby writer = Clive Endersby starring = Gema Zamprogna Gwynyth Walsh Eric Christmas music = Eric N. Robertson cinematography =… …   Wikipedia

  • Код аутентичности — MAC (имитовставка, англ. message authentication code  код аутентичности сообщения) средство обеспечения имитозащиты в протоколах аутентификации сообщений с доверяющими друг другу участниками  специальный набор символов, который добавляется к… …   Википедия

  • Код аутентичности сообщения — MAC (имитовставка, англ. message authentication code  код аутентичности сообщения) средство обеспечения имитозащиты в протоколах аутентификации сообщений с доверяющими друг другу участниками  специальный набор символов, который добавляется к… …   Википедия

  • Cipher Block Chaining — Mode (CBC) ist eine Betriebsart, in der Blockchiffren betrieben werden können. Vor dem Verschlüsseln eines Klartextblocks wird dieser zunächst mit dem im letzten Schritt erzeugten Geheimtextblock per XOR (exklusives Oder) verknüpft.… …   Deutsch Wikipedia

  • CMAC — This article is about the cyptographic construction. For other uses, see CMAC (disambiguation). In cryptography, CMAC (Cipher based MAC)[1] is a block cipher based message authentication code algorithm. It may be used to provide assurance of the… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”