1、raising standards worldwide NO COPYING WITHOUT BSI PERMISSION EXCEPT AS PERMITTED BY COPYRIGHT LAW BSI Standards Publication BS ISO/IEC 9797-1:2011 Information technology Security techniques Message Authentication Codes (MACs) Part 1: Mechanisms using a block cipherBS ISO/IEC 9797-1:2011 BRITISH STA
2、NDARD National foreword This British Standard is the UK implementation of ISO/IEC 9797-1:2011. The UK participation in its preparation was entrusted to Technical Committee IST/33, IT - Security techniques. A list of organizations represented on this committee can be obtained on request to its secret
3、ary. This publication does not purport to include all the necessary provisions of a contract. Users are responsible for its correct application. BSI 2011 ISBN 978 0 580 54173 5 ICS 35.040 Compliance with a British Standard cannot confer immunity from legal obligations. This British Standard was publ
4、ished under the authority of the Standards Policy and Strategy Committee on 31 March 2011. Amendments issued since publication Date Text affectedBS ISO/IEC 9797-1:2011Reference number ISO/IEC 9797-1:2011(E) ISO/IEC 2011INTERNATIONAL STANDARD ISO/IEC 9797-1 Second edition 2011-03-01 Information techn
5、ology Security techniques Message Authentication Codes (MACs) Part 1: Mechanisms using a block cipher Technologies de linformation Techniques de scurit Codes dauthentification de message (MAC) Partie 1: Mcanismes utilisant un chiffrement par blocs BS ISO/IEC 9797-1:2011 ISO/IEC 9797-1:2011(E) PDF di
6、sclaimer This PDF file may contain embedded typefaces. In accordance with Adobes licensing policy, this file may be printed or viewed but shall not be edited unless the typefaces which are embedded are licensed to and installed on the computer performing the editing. In downloading this file, partie
7、s accept therein the responsibility of not infringing Adobes licensing policy. The ISO Central Secretariat accepts no liability in this area. Adobe is a trademark of Adobe Systems Incorporated. Details of the software products used to create this PDF file can be found in the General Info relative to
8、 the file; the PDF-creation parameters were optimized for printing. Every care has been taken to ensure that the file is suitable for use by ISO member bodies. In the unlikely event that a problem relating to it is found, please inform the Central Secretariat at the address given below. COPYRIGHT PR
9、OTECTED DOCUMENT ISO/IEC 2011 All rights reserved. Unless otherwise specified, no part of this publication may be reproduced or utilized in any form or by any means, electronic or mechanical, including photocopying and microfilm, without permission in writing from either ISO at the address below or
10、ISOs member body in the country of the requester. ISO copyright office Case postale 56 CH-1211 Geneva 20 Tel. + 41 22 749 01 11 Fax + 41 22 749 09 47 E-mail copyrightiso.org Web www.iso.org Published in Switzerland ii ISO/IEC 2011 All rights reservedBS ISO/IEC 9797-1:2011 ISO/IEC 9797-1:2011(E) ISO/
11、IEC 2011 All rights reserved iiiContents Page Foreword .v Introductionvi 1 Scope1 2 Normative references1 3 Terms and definitions .1 4 Symbols and notation.3 5 Requirements.4 6 Model for MAC algorithms5 6.1 General .5 6.2 Step 1 (key derivation) 6 6.2.1 General .6 6.2.2 Key Derivation Method 1.6 6.2
12、.3 Key Derivation Method 2.7 6.3 Step 2 (padding) 7 6.3.1 General .7 6.3.2 Padding Method 17 6.3.3 Padding Method 27 6.3.4 Padding Method 37 6.3.5 Padding Method 48 6.4 Step 3 (splitting) 8 6.5 Step 4 (iteration) 8 6.6 Step 5 (final iteration)8 6.6.1 General .8 6.6.2 Final iteration 18 6.6.3 Final i
13、teration 28 6.6.4 Final iteration 39 6.7 Step 6 (output transformation).9 6.7.1 General .9 6.7.2 Output Transformation 1 9 6.7.3 Output Transformation 2 9 6.7.4 Output Transformation 3 9 6.8 Step 7 (truncation).9 7 MAC algorithms.9 7.1 General .9 7.2 MAC Algorithm 1 .10 7.3 MAC Algorithm 2 .10 7.4 M
14、AC Algorithm 3 .11 7.5 MAC Algorithm 4 .12 7.6 MAC Algorithm 5 .13 7.7 MAC Algorithm 6 .14 Annex A (normative) Object identifiers 16 Annex B (informative) Examples .19 B.1 General.19 B.2 MAC Algorithm 1 .20 B.3 MAC Algorithm 2 .22 B.4 MAC Algorithm 3 .23 B.5 MAC Algorithm 4 .24 BS ISO/IEC 9797-1:201
15、1 ISO/IEC 9797-1:2011(E) iv ISO/IEC 2011 All rights reservedB.6 MAC Algorithm 5. 26 B.6.1 Examples of MAC generation process . 26 B.6.2 AES using a 128-bit key . 27 B.6.3 AES using a 192-bit key . 27 B.6.4 AES using a 256-bit key . 27 B.6.5 Three-key triple DEA 28 B.6.6 Two-key triple DEA . 28 B.7 M
16、AC Algorithm 6. 29 B.7.1 Examples of MAC generation process . 29 B.7.2 AES using a 128-bit key . 29 B.7.3 AES using a 192-bit key . 29 B.7.4 AES using a 256-bit key . 30 Annex C (informative) A security analysis of the MAC algorithms. 31 C.1 General. 31 C.2 Rationale 33 Annex D (informative) A compa
17、rison with previous MAC algorithm standards 38 Bibliography. 39 BS ISO/IEC 9797-1:2011 ISO/IEC 9797-1:2011(E) ISO/IEC 2011 All rights reserved vForeword ISO (the International Organization for Standardization) and IEC (the International Electrotechnical Commission) form the specialized system for wo
18、rldwide standardization. National bodies that are members of ISO or IEC participate in the development of International Standards through technical committees established by the respective organization to deal with particular fields of technical activity. ISO and IEC technical committees collaborate
19、 in fields of mutual interest. Other international organizations, governmental and non-governmental, in liaison with ISO and IEC, also take part in the work. In the field of information technology, ISO and IEC have established a joint technical committee, ISO/IEC JTC 1. International Standards are d
20、rafted in accordance with the rules given in the ISO/IEC Directives, Part 2. The main task of the joint technical committee is to prepare International Standards. Draft International Standards adopted by the joint technical committee are circulated to national bodies for voting. Publication as an In
21、ternational Standard requires approval by at least 75 % of the national bodies casting a vote. Attention is drawn to the possibility that some of the elements of this document may be the subject of patent rights. ISO and IEC shall not be held responsible for identifying any or all such patent rights
22、. ISO/IEC 9797-1 was prepared by Joint Technical Committee ISO/IEC JTC 1, Information technology, Subcommittee SC 27, IT Security techniques. This second edition cancels and replaces the first edition (ISO/IEC 9797-1:1999), which has been technically revised. MAC Algorithms 5 and 6 of ISO/IEC 9797-1
23、:1999, which consisted of two single CBC-MAC computations, have been replaced by two other MAC algorithms, which perform single CBC-MAC computations and which offer improved efficiency. Annex A on object identifiers has been added. The security analysis in Annex C has been updated and Annex D on the
24、 relationship to previous standards has been added. ISO/IEC 9797 consists of the following parts, under the general title Information technology Security techniques Message Authentication Codes (MACs): Part 1: Mechanisms using a block cipher Part 2: Mechanisms using a dedicated hash-function Part 3:
25、 Mechanisms using a universal hash-function Further parts may follow. BS ISO/IEC 9797-1:2011 ISO/IEC 9797-1:2011(E) vi ISO/IEC 2011 All rights reservedIntroduction In an IT environment, it is often required that one can verify that electronic data has not been altered in an unauthorized manner and t
26、hat one can provide assurance that a message has been originated by an entity in possession of the secret key. A MAC (Message Authentication Code) algorithm is a commonly used data integrity mechanism that can satisfy these requirements. This part of ISO/IEC 9797 specifies six MAC algorithms that ar
27、e based on an n-bit block cipher. They compute a short string as a function of a secret key and a message of variable length. The strength of the data integrity mechanism and message authentication mechanism is dependent on the length (in bits) k and secrecy of the key, on the block length (in bits)
28、 n and strength of the block cipher, on the length (in bits) m of the MAC, and on the specific mechanism. The first mechanism specified in this part of ISO/IEC 9797 is commonly known as CBC-MAC (CBC is an abbreviation of Cipher Block Chaining). The other five mechanisms are variants of CBC-MAC. MAC
29、Algorithms 2, 3, 5 and 6 apply a special transformation at the end of the processing. MAC Algorithm 6 is an optimized variant of MAC Algorithm 2. MAC Algorithm 5 uses the minimum number of encryptions. MAC Algorithm 5 requires only a single block cipher key setup but it needs a longer internal key.
30、MAC Algorithm 4 applies a special transformation at both the beginning and the end of the processing; this algorithm is recommended for use in applications which require that the key length of the MAC algorithm be twice that of the block cipher. BS ISO/IEC 9797-1:2011 INTERNATIONAL STANDARD ISO/IEC
31、9797-1:2011(E) ISO/IEC 2011 All rights reserved 1Information technology Security techniques Message Authentication Codes (MACs) Part 1: Mechanisms using a block cipher 1 Scope This part of ISO/IEC 9797 specifies six MAC algorithms that use a secret key and an n-bit block cipher to calculate an m-bit
32、 MAC. This part of ISO/IEC 9797 can be applied to the security services of any security architecture, process, or application. Key management mechanisms are outside the scope of this part of ISO/IEC 9797. This part of ISO/IEC 9797 specifies object identifiers that can be used to identify each mechan
33、ism in accordance with ISO/IEC 8825-1. Numerical examples and a security analysis of each of the six specified algorithms are provided, and the relationship of this part of ISO/IEC 9797 to previous standards is explained. 2 Normative references The following referenced documents are indispensable fo
34、r the application of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies. ISO/IEC 18033-3, Information technology Security techniques Encryption algorithms Part 3: Block ciphers
35、3 Terms and definitions For the purposes of this document, the following terms and definitions apply. 3.1 block bit string of length n 3.2 block cipher key key that controls the operation of a block cipher 3.3 ciphertext data which has been transformed to hide its information content ISO/IEC 9798-1:
36、2010 BS ISO/IEC 9797-1:2011 ISO/IEC 9797-1:2011(E) 2 ISO/IEC 2011 All rights reserved3.4 data integrity property that data has not been altered or destroyed in an unauthorized manner ISO 7498-2 3.5 decryption reversal of a corresponding encryption ISO/IEC 9798-1:2010 3.6 encryption reversible operat
37、ion by a cryptographic algorithm converting data into ciphertext so as to hide the information content of the data ISO/IEC 9798-1:2010 3.7 key sequence of symbols that controls the operation of a cryptographic transformation NOTE Examples are encryption, decryption, cryptographic check function comp
38、utation, signature generation, or signature verification. ISO/IEC 9798-1:2010 3.8 MAC algorithm key key that controls the operation of a MAC algorithm 3.9 Message Authentication Code MAC string of bits which is the output of a MAC algorithm NOTE A MAC is sometimes called a cryptographic check value
39、(see for example ISO 7498-2 1). 3.10 Message Authentication Code algorithm MAC algorithm algorithm for computing a function which maps strings of bits and a secret key to fixed-length strings of bits, satisfying the following two properties: for any key and any input string, the function can be comp
40、uted efficiently; for any fixed key, and given no prior knowledge of the key, it is computationally infeasible to compute the function value on any new input string, even given knowledge of a set of input strings and corresponding function values, where the value of the ith input string might have b
41、een chosen after observing the value of the first i -1 function values (for integers i 1) NOTE 1 A MAC algorithm is sometimes called a cryptographic check function (see for example ISO 7498-2 1). NOTE 2 Computational feasibility depends on the users specific security requirements and environment. 3.
42、11 n-bit block cipher block cipher with the property that plaintext blocks and ciphertext blocks are n bits in length ISO/IEC 10116 BS ISO/IEC 9797-1:2011 ISO/IEC 9797-1:2011(E) ISO/IEC 2011 All rights reserved 33.12 output transformation function that is applied at the end of the MAC algorithm, bef
43、ore the truncation operation 3.13 plaintext unencrypted information NOTE Adapted from ISO/IEC 9798-1:2010. 4 Symbols and notation Throughout this part of ISO/IEC 9797 the following symbols and notation are used: CT in-bit binary representation of the integer i. D data string to be input to the MAC a
44、lgorithm. D jblock derived from the data string D after the padding and splitting process. d K (C) decryption of the ciphertext C with the block cipher e using the key K. e K (P) encryption of the plaintext P with the block cipher e using the key K. F final iteration. g output transformation that ma
45、ps the block H qto the block G. G block that is the result of the output transformation. GF(2 n ) finite field with exactly 2 nelements. H 0 ,H 1 ,H qblocks used in the MAC algorithm to store intermediate results. k length (in bits) of the block cipher key. k* length (in bits) of the MAC algorithm k
46、ey. K, K, K secret block cipher keys of length (in bits) k. K 1 , K 2secret masking keys of length (in bits) n. L length block, used in Padding Method 3, equal to the binary representation of the length of the input message, left-padded to form an n-bit block. L Dlength (in bits) of the data string
47、D. m length (in bits) of the MAC. multx(T) operation on an n-bit string T defined as Tx, where T is treated as an element in the finite field GF(2 n ), and is multiplied by the element corresponding to the monomial x in GF(2 n ). It can be computed as follows, where T n-1denotes the leftmost bit of
48、T and, as defined below, denotes a one-bit left shift operation. m u l t x ( T) = 1 11 if 0( 1 ) if 1 n n n TT TP T = = n block length (in bits) of the block cipher. BS ISO/IEC 9797-1:2011 ISO/IEC 9797-1:2011(E) 4 ISO/IEC 2011 All rights reservedp n (x) irreducible polynomials of degree n over GF(2)
49、, that is, polynomials with no non-trivial divisors. n p string of bits of length n, consisting of the rightmost n coefficients (corresponding to x n-1 , x n-2 , , x, x 0= 1) of the irreducible polynomial p n (x). For n=128, p n (x) = x 128+ x 7 + x 2+ x + 1, and 128 p = 0 120 10000111. For n=64, p n (x) = x 64+ x 4 + x 3+ x + 1, and 64 p = 0 59 11011. q number of blocks in the data string D after the padding and splitting process. S secret strin