Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Model  



1.1  Padding  



1.1.1  Padding method 1  





1.1.2  Padding method 2  





1.1.3  Padding method 3  







1.2  Splitting  





1.3  Initial transformation  



1.3.1  Initial transformation 1  





1.3.2  Initial transformation 2  







1.4  Iteration  





1.5  Output transformation  



1.5.1  Output transformation 1  





1.5.2  Output transformation 2  





1.5.3  Output transformation 3  







1.6  Truncation  







2 Specific algorithms  



2.1  MAC algorithm 1  





2.2  MAC algorithm 2  





2.3  MAC algorithm 3  





2.4  MAC algorithm 4  





2.5  MAC algorithm 5  





2.6  MAC algorithm 6  







3 Key derivation  





4 Complete specification of the MAC calculation  





5 Security analysis of the algorithms  





6 References  














ISO/IEC 9797-1






Čeština
Español
Українська
 

Edit links
 









Article
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Cite this page
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 


ISO/IEC 9797-1 Information technology – Security techniques – Message Authentication Codes (MACs) – Part 1: Mechanisms using a block cipher[1] is an international standard that defines methods for calculating a message authentication code (MAC) over data.

Rather than defining one specific algorithm, the standard defines a general model from which a variety of specific algorithms can be constructed. The model is based on a block cipher with a secret symmetric key.

Because the standard describes a model rather than a specific algorithm, users of the standard must specify all of the particular options and parameter to be used, to ensure unambiguous MAC calculation.

Model[edit]

The model for MAC generation comprises six steps:

  1. Padding of the data to a multiple of the cipher block size
  2. Splitting of the data into blocks
  3. Initial transformation of the first block of data
  4. Iteration through the remaining blocks of data
  5. Output transformation of the result of the last iteration
  6. Truncation of the result to the required length

For most steps, the standard provides several options from which to choose, and/or allows some configurability.

Padding[edit]

The input data must be padded to a multiple of the cipher block size, so that each subsequent cryptographic operation will have a complete block of data. Three padding methods are defined. In each case n is the block length (inbits):

Padding method 1[edit]

If necessary, add bits with value 0 to the end of the data until the padded data is a multiple of n. (If the original data was already a multiple of n, no bits are added.)

Padding method 2[edit]

Add a single bit with value 1 to the end of the data. Then if necessary add bits with value 0 to the end of the data until the padded data is a multiple of n.

Padding method 3[edit]

The padded data comprises (in this order):

It is not necessary to transmit or store the padding bits, because the recipient can regenerate them, knowing the length of the unpadded data and the padding method used.

Splitting[edit]

The padded data D is split into q blocks D1, D2, ... Dq, each of length n, suitable for the block cipher.

Initial transformation[edit]

A cryptographic operation is performed on the first block (D1), to create an intermediate block H1. Two initial transformations are defined:

Initial transformation 1[edit]

D1 is encrypted with the key K:

H1 = eK(D1)

Initial transformation 2[edit]

D1 is encrypted with the key K, and then by a second key K′′:

H1 = eK′′(eK(D1))

Iteration[edit]

Blocks H2 ... Hq are calculated by encrypting, with the key K, the bitwise exclusive-or of the corresponding data block and the previous H block.

for i = 2 to q
Hi = eK(DiHi-1)

If there is only one data block (q=1), this step is omitted.

Output transformation[edit]

A cryptographic operation is (optionally) performed on the last iteration output block Hq to produce the block G. Three output transformations are defined:

Output transformation 1[edit]

Hq is used unchanged:

G = Hq

Output transformation 2[edit]

Hq is encrypted with the key K′:

G = eK(Hq)

Output transformation 3[edit]

Hq is decrypted with the key K′ and the result encrypted with the key K:

G = eK(dK(Hq))

Truncation[edit]

The MAC is obtained by truncating the block G (keeping the leftmost bits, discarding the rightmost bits), to the required length.

Specific algorithms[edit]

The general model nominally allows for any combination of options for each of the padding, initial transformation, output transformation, and truncation steps. However, the standard defines four particular combinations of initial and output transformation and (where appropriate) key derivation, and two further combinations based on duplicate parallel calculations. The combinations are denoted by the standard as "MAC Algorithm 1" through "MAC Algorithm 6".

MAC algorithm 1[edit]

This algorithm uses initial transformation 1 and output transformation 1.

Only one key is required, K.

(When the block cipher is DES, this is equivalent to the algorithm specified in FIPS PUB 113 Computer Data Authentication.[2])

Algorithm 1 is commonly known as CBC-MAC.[3]

MAC algorithm 2[edit]

This algorithm uses initial transformation 1 and output transformation 2.

Two keys are required, K and K′, but K′ may be derived from K.

MAC algorithm 3[edit]

This algorithm uses initial transformation 1 and output transformation 3.

Two independent keys are required, K and K′.

Algorithm 3 is also known as Retail MAC.[4]

MAC algorithm 4[edit]

This algorithm uses initial transformation 2 and output transformation 2.

Two independent keys are required, K and K′, with a third key K′′ derived from K′.

MAC algorithm 5[edit]

MAC algorithm 5 comprises two parallel instances of MAC algorithm 1. The first instance operates on the original input data. The second instance operates on two key variants generated from the original key via multiplication in a Galois field. The final MAC is computed by the bitwise exclusive-or of the MACs generated by each instance of algorithm 1.[5]

Algorithm 5 is also known as CMAC.[6]

MAC algorithm 6[edit]

This algorithm comprises two parallel instances of MAC algorithm 4. The final MAC is the bitwise exclusive-or of the MACs generated by each instance of algorithm 4.[7]

Each instance of algorithm 4 uses a different key pair (K and K′) but those four keys are derived from two independent base keys.

Key derivation[edit]

MAC algorithms 2 (optionally), 4, 5 and 6 require deriving one or more keys from another key. The standard does not mandate any particular method of key derivation, although it does generally mandate that derived keys be different from each other.

The standard gives some examples of key derivation methods, such as "complement alternate substrings of four bits of K commencing with the first four bits." This is equivalent to bitwise exclusive-oring each byte of the key with F0 (hex).

Complete specification of the MAC calculation[edit]

To completely and unambiguously define the MAC calculation, a user of ISO/IEC 9797-1 must select and specify:

Security analysis of the algorithms[edit]

Annex B of the standard is a security analysis of the MAC algorithms. It describes various cryptographic attacks on the algorithms – including key-recovery attack, brute force key recovery, and birthday attack – and analyses the resistance of each algorithm to those attacks.

References[edit]

  • ^ "FIPS PUB 113 - Computer Data Authentication". National Institute of Standards and Technology. Archived from the original on 2011-09-27. Retrieved 2011-10-01.
  • ^ ISO/IEC 9797-1:2011 Information technology – Security techniques – Message Authentication Codes (MACs) – Part 1: Mechanisms using a block cipher, Introduction
  • ^ ISO/IEC 9797-1 Information technology – Security techniques – Message Authentication Codes (MACs) – Part 1: Mechanisms using a block cipher. International Organization for Standardization. 2011. p. 11.
  • ^ ISO/IEC 9797-1 Information technology – Security techniques – Message Authentication Codes (MACs) – Part 1: Mechanisms using a block cipher. International Organization for Standardization. 2011. p. 12.
  • ^ ISO/IEC 9797-1 Information technology – Security techniques – Message Authentication Codes (MACs) – Part 1: Mechanisms using a block cipher. International Organization for Standardization. 2011. p. 13.
  • ^ ISO/IEC 9797-1:1999 Information technology -- Security techniques -- Message Authentication Codes (MACs) -- Part 1: Mechanisms using a block cipher — Superseded by ISO/IEC 9797-1:2011, which (according to the latter's Foreword) has a different algorithm 6.

  • Retrieved from "https://en.wikipedia.org/w/index.php?title=ISO/IEC_9797-1&oldid=1233232145"

    Categories: 
    Message authentication codes
    ISO/IEC 9797
    Hidden categories: 
    Articles with short description
    Short description matches Wikidata
    Use Oxford spelling from January 2012
    Wikipedia articles in need of updating from May 2016
    All Wikipedia articles in need of updating
     



    This page was last edited on 8 July 2024, at 00:23 (UTC).

    Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



    Privacy policy

    About Wikipedia

    Disclaimers

    Contact Wikipedia

    Code of Conduct

    Developers

    Statistics

    Cookie statement

    Mobile view



    Wikimedia Foundation
    Powered by MediaWiki