idnits 2.17.1 draft-cfrg-re-keying-00.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack an IANA Considerations section. (See Section 2.2 of https://www.ietf.org/id-info/checklist for how to handle the case when there are no actions for IANA.) ** There are 17 instances of too long lines in the document, the longest one being 15 characters in excess of 72. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (February 20, 2017) is 2616 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Informational ---------------------------------------------------------------------------- -- Looks like a reference, but probably isn't: '1' on line 701 == Missing Reference: '2t' is mentioned on line 672, but not defined == Missing Reference: 'K' is mentioned on line 1203, but not defined Summary: 2 errors (**), 0 flaws (~~), 3 warnings (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 CFRG S. Smyshlyaev, Ed. 3 Internet-Draft CryptoPro 4 Intended status: Informational R. Housley 5 Expires: August 24, 2017 Vigil Security, LLC 6 M. Bellare 7 University of California, San Diego 8 E. Alekseev 9 E. Smyshlyaeva 10 CryptoPro 11 D. Franke 12 Akamai Technologies 13 L. Ahmetzyanova 14 CryptoPro 15 R. Ng 16 University of California, San Diego 17 February 20, 2017 19 Re-keying Mechanisms for Symmetric Keys 20 draft-cfrg-re-keying-00 22 Abstract 24 This specification contains a description of a variety of methods to 25 increase the lifetime of symmetric keys. It provides external and 26 internal re-keying mechanisms that can be used with such modes of 27 operations as CTR, GCM, CBC, CFB, OFB and OMAC. 29 Status of This Memo 31 This Internet-Draft is submitted in full conformance with the 32 provisions of BCP 78 and BCP 79. 34 Internet-Drafts are working documents of the Internet Engineering 35 Task Force (IETF). Note that other groups may also distribute 36 working documents as Internet-Drafts. The list of current Internet- 37 Drafts is at http://datatracker.ietf.org/drafts/current/. 39 Internet-Drafts are draft documents valid for a maximum of six months 40 and may be updated, replaced, or obsoleted by other documents at any 41 time. It is inappropriate to use Internet-Drafts as reference 42 material or to cite them other than as "work in progress." 44 This Internet-Draft will expire on August 24, 2017. 46 Copyright Notice 48 Copyright (c) 2017 IETF Trust and the persons identified as the 49 document authors. All rights reserved. 51 This document is subject to BCP 78 and the IETF Trust's Legal 52 Provisions Relating to IETF Documents 53 (http://trustee.ietf.org/license-info) in effect on the date of 54 publication of this document. Please review these documents 55 carefully, as they describe your rights and restrictions with respect 56 to this document. Code Components extracted from this document must 57 include Simplified BSD License text as described in Section 4.e of 58 the Trust Legal Provisions and are provided without warranty as 59 described in the Simplified BSD License. 61 Table of Contents 63 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 64 2. Conventions Used in This Document . . . . . . . . . . . . . . 3 65 3. Basic Terms and Definitions . . . . . . . . . . . . . . . . . 3 66 4. External Re-keying Mechanisms . . . . . . . . . . . . . . . . 5 67 4.1. Parallel Constructions . . . . . . . . . . . . . . . . . 5 68 4.1.1. Parallel Construction Based on a KDF on a Block 69 Cipher . . . . . . . . . . . . . . . . . . . . . . . 6 70 4.1.2. Parallel Construction Based on HKDF . . . . . . . . . 6 71 4.2. Serial Constructions . . . . . . . . . . . . . . . . . . 7 72 4.2.1. Serial Construction Based on a KDF on a Block Cipher 7 73 4.2.2. Serial Construction Based on HKDF . . . . . . . . . . 8 74 5. Internal Re-keying Mechanisms . . . . . . . . . . . . . . . . 8 75 5.1. Constructions that Do Not Require Master Key . . . . . . 8 76 5.1.1. ACPKM Re-keying Mechanisms . . . . . . . . . . . . . 8 77 5.1.2. CTR-ACPKM Encryption Mode . . . . . . . . . . . . . . 10 78 5.1.3. GCM-ACPKM Encryption Mode . . . . . . . . . . . . . . 12 79 5.2. Constructions that Require Master Key . . . . . . . . . . 14 80 5.2.1. ACPKM-Master Key Generation from the Master Key . . . 15 81 5.2.2. CTR Mode Key Meshing . . . . . . . . . . . . . . . . 17 82 5.2.3. GCM Mode Key Meshing . . . . . . . . . . . . . . . . 19 83 5.2.4. CBC Mode Key Meshing . . . . . . . . . . . . . . . . 22 84 5.2.5. CFB Mode Key Meshing . . . . . . . . . . . . . . . . 24 85 5.2.6. OFB Mode Key Meshing . . . . . . . . . . . . . . . . 26 86 5.2.7. OMAC Mode Key Meshing . . . . . . . . . . . . . . . . 27 87 6. Joint Usage of External and Internal Re-keying . . . . . . . 29 88 7. Security Considerations . . . . . . . . . . . . . . . . . . . 29 89 7.1. Principles of Choice of Constructions and Security 90 Parameters . . . . . . . . . . . . . . . . . . . . . . . 29 91 7.2. Requirements For Base Primitives . . . . . . . . . . . . 30 92 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 30 93 8.1. Normative References . . . . . . . . . . . . . . . . . . 30 94 8.2. Informative References . . . . . . . . . . . . . . . . . 31 95 Appendix A. Test examples . . . . . . . . . . . . . . . . . . . 31 96 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 35 98 1. Introduction 100 Common attacks base their success on the ability to get many 101 encryptions under a single key. If encryption is performed under a 102 single key, there is a certain maximum threshold number of messages 103 that can be safely encrypted. These restrictions can come either 104 from combinatorial properties of the used cipher modes of operation 105 (for example, birthday attack [BDJR]) or from particular 106 cryptographic attacks on the used block cipher (for example, linear 107 cryptanalysis [Matsui]). Moreover, most strict restrictions here 108 follow from the need to resist side-channel attacks. The adversary's 109 opportunity to obtain an essential amount of data processed with a 110 single key leads not only to theoretic but also to practical 111 vulnerabilities (see [BL]). Therefore, when the total size of a 112 plaintext processed with a single key reaches threshold values, this 113 key cannot be used anymore and certain procedures with encryption 114 keys are needed. 116 The most simple and obvious way for overcoming the key lifetimes 117 limitations is a renegotiation of a regular session key. However, 118 this reduces the total performance since it usually entails the 119 frequent use of a public key cryptography. 121 Another way is to use a transformation of a previously negotiated 122 key. This specification presents the description of such mechanisms 123 and the description of the cases when these mechanisms should be 124 applied. 126 2. Conventions Used in This Document 128 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 129 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 130 document are to be interpreted as described in [RFC2119]. 132 3. Basic Terms and Definitions 134 This document uses the following terms and definitions for the sets 135 and operations on the elements of these sets: 137 (xor) exclusive-or of two binary vectors of the same length. 139 V* the set of all strings of a finite length (hereinafter 140 referred to as strings), including the empty string; 142 V_s the set of all binary strings of length s, where s is a non- 143 negative integer; substrings and string components are 144 enumerated from right to left starting from one; 146 |X| the bit length of the bit string X; 148 A|B concatenation of strings A and B both belonging to V*, i.e., 149 a string in V_{|A|+|B|}, where the left substring in V_|A| is 150 equal to A, and the right substring in V_|B| is equal to B; 152 Z_{2^n} ring of residues modulo 2^n; 154 Int_s: V_s -> Z_{2^s} the transformation that maps a string a = 155 (a_s, ... , a_1), a in V_s, into the integer Int_s(a) = 156 2^s*a_s + ... + 2*a_2 + a_1; 158 Vec_s: Z_{2^s} -> V_s the transformation inverse to the mapping 159 Int_s; 161 MSB_i: V_s -> V_i the transformation that maps the string a = (a_s, 162 ... , a_1) in V_s, into the string MSB_i(a) = (a_s, ... , 163 a_{s-i+1}) in V_i; 165 LSB_i: V_s -> V_i the transformation that maps the string a = (a_s, 166 ... , a_1) in V_s, into the string LSB_i(a) = (a_i, ... , 167 a_1) in V_i; 169 Inc_c: V_s -> V_s the transformation that maps the string a = (a_s, 170 ... , a_1) in V_s, into the string Inc_c(a) = MSB_{|a|- 171 c}(a) | Vec_c(Int_c(LSB_c(a)) + 1(mod 2^c)) in V_s; 173 a^s denotes the string in V_s that consists of s 'a' bits; 175 E_{K}: V_n -> V_n the block cipher permutation under the key K in 176 V_k; 178 ceil(x) the least integer that is not less than x; 180 k the key K size (in bits); 182 n the block size of the block cipher (in bits); 184 b the total number of data blocks in the plaintext (b = ceil(m/ 185 n)); 187 N the section size (the number of bits in a data section); 189 l the number of data sections in the plaintext; 190 m the message M size (in bits); 192 phi_i: V_s -> V_s the transformation that maps a string a = (a_s, 193 ... , a_1) into the string phi_i(a) = a' = (a'_s, ... , 194 a'_1), 1 <= i <= s, such that a'_i = 1 and a'_j = a_j for all 195 j in {1, ... , s}\{i}. 197 A plaintext message P and a ciphertext C are divided into b = ceil(m/ 198 n) segments denoted as P = P_1 | P_2 | ... | P_b and C = C_1 | C_2 | 199 ... | C_b, where P_i and C_i are in V_n, for i = 1, 2, ... , b-1, and 200 P_b, C_b are in V_r, where r <= n if not otherwise stated. 202 4. External Re-keying Mechanisms 204 This section presents an approach to increase the lifetime of 205 negotiated keys after processing a limited number of integral 206 messages. It provides an external parallel and serial re-keying 207 mechanisms (see [AbBell]). These mechanisms use an initial 208 (negotiated) key as a master key, which is never used directly for 209 the data processing but is used for key generation. Such mechanisms 210 operate outside of the base modes of operations and do not change 211 them at all, therefore they are called "external re-keying" in this 212 document. 214 4.1. Parallel Constructions 216 The main idea behind external re-keying with parallel construction is 217 presented in Fig.1: 219 Lifetime of a key = L, 220 maximum message size = m_max. 221 _____________________________________________________________ 223 m_max 224 <----------------> 225 M_{1,1} |=== | 226 M_{1,2} |=============== | 227 +--K^1--> . . . 228 | M_{1,q_1} |======== | 229 | 230 | 231 | M_{2,1} |================| 232 | M_{2,2} |===== | 233 K*----|--K^2--> . . . 234 | M_{2,q_2} |========== | 235 | 236 ... 237 | M_{t,1} |============ | 238 | M_{t,2} |============= | 239 +--K^t--> . . . 240 M_{t,q_t} |========== | 242 _____________________________________________________________ 243 |M_{i,1}| + ... + |M_{i,q_i}| <= L, i = 1, ... , t. 245 Figure 1: External parallel re-keying mechanisms 247 4.1.1. Parallel Construction Based on a KDF on a Block Cipher 249 ExtParallelC re-keying mechanism is based on a block cipher and is 250 used to generate t keys for t sections as follows: 252 K^1 | K^2 | ... | K^t = ExtParallelC(K*, t*k) = 253 MSB_{t*k}(E_{K*}(0) | E_{K*}(1) | ... | E_{K*}(J-1)), 255 where J = ceil(k/n). 257 4.1.2. Parallel Construction Based on HKDF 259 ExtParallelH re-keying mechanism is based on HMAC-based key 260 derivation function HKDF-Expand, described in [RFC5869], and is used 261 to generate t keys for t sections as follows: 263 K^1 | K^2 | ... | K^t = ExtParallelH(K*, t*k) = HKDF-Expand(K*, 264 label, t*k), 266 where label is a string (can be a zero-length string) that is defined 267 by a specific protocol. 269 4.2. Serial Constructions 271 The main idea behind external re-keying with serial construction is 272 presented in Fig.2: 274 Lifetime of a key = L, 275 maximum message size = m_max. 276 _____________________________________________________________ 277 m_max 278 <----------------> 279 M_{1,1} |=== | 280 M_{1,2} |=============== | 281 K*_1 = K* ---K^1--> . . . 282 | M_{1,q_1} |======== | 283 | 284 | 285 | M_{2,1} |================| 286 v M_{2,2} |===== | 287 K*_2 --------K^2--> . . . 288 | M_{2,q_2} |========== | 289 | 290 ... 291 | M_{t,1} |============ | 292 v M_{t,2} |============= | 293 K*_t --------K^t--> . . . 294 M_{t,q_t} |========== | 296 _____________________________________________________________ 297 |M_{i,1}| + ... + |M_{i,q_i}| <= L, i = 1, ... , t. 299 Figure 2: External serial re-keying mechanisms 301 4.2.1. Serial Construction Based on a KDF on a Block Cipher 303 The key K^i is calculated using ExtSerialC transformation as follows: 305 K^i = ExtSerialC(K*, i) = MSB_k(E_{K*_i}(0) | E_{K*_i}(1) | ... | 306 E_{K*_i}(J-1)), 308 where J = ceil(k/n), i = 1, ... , t, K*_i is calculated as follows: 310 K*_1 = K*, 311 K*_{j+1} = MSB_k(E_{K*_j}(J) | E_{K*_j}(J+1) | ... | E_{K*_j}(2J- 312 1)), 314 where j = 1, ... , t-1. 316 4.2.2. Serial Construction Based on HKDF 318 The key K^i is calculated using ExtSerialH transformation as follows: 320 K^i = ExtSerialH(K*, i) = HKDF-Expand(K*_i, label1, k), 322 where i = 1, ... , t, HKDF-Expand is an HMAC-based key derivation 323 function, described in [RFC5869], K*_i is calculated as follows: 325 K*_1 = K*, 327 K*_{j+1} = HKDF-Expand(K*_j, label2, k), where j = 1, ... , t-1, 329 where label1 and label2 are different strings (can be a zero-length 330 strings) that are defined by a specific protocol (see, for example, 331 TLS 1.3 updating traffic keys algorithm [TLSDraft]). 333 5. Internal Re-keying Mechanisms 335 This section presents an approach to increase the lifetime of 336 negotiated key by re-keying during each separate message processing. 337 It provides an internal re-keying mechanisms called ACPKM and ACPKM- 338 Master that do not use and use a master key respectively. Such 339 mechanisms are integrated into the base modes of operations and can 340 be considered as the base mode extensions, therefore they are called 341 "internal re-keying" in this document. 343 5.1. Constructions that Do Not Require Master Key 345 This section describes the block cipher modes that uses the ACPKM re- 346 keying mechanism (described in Section 5.1.1), which does not use 347 master key: an initial key is used directly for the encryption of the 348 data. 350 5.1.1. ACPKM Re-keying Mechanisms 352 This section defines periodical key transformation with no master key 353 which is called ACPKM re-keying mechanism. This mechanism can be 354 applied to one of the basic encryption modes (CTR and GCM block 355 cipher modes) for getting an extension of this encryption mode that 356 uses periodical key transformation with no master key. This 357 extension can be considered as a new encryption mode. 359 An additional parameter that defines the functioning of basic 360 encryption modes with the ACPKM re-keying mechanism is the section 361 size N. The value of N is measured in bits and is fixed within a 362 specific protocol based on the requirements of the system capacity 363 and key lifetime (some recommendations on choosing N will be provided 364 in Section 7). The section size N MUST be divisible by the block 365 size n. 367 The main idea behind internal re-keying with no master key is 368 presented in Fig.3: 370 Lifetime of a key = L, 371 section size = const = N, 372 maximum message size = m_max. 373 ____________________________________________________________________ 375 ACPKM ACPKM ACPKM 376 K^1 = K ---> K^2 ---...-> K^{l_max-1} ----> K^{l_max} 377 | | | | 378 | | | | 379 v v v v 380 Message(1) |==========|==========| ... |==========|=======: | 381 Message(2) |==========|==========| ... |=== | : | 382 . . . . . . : . 383 : : : : : : : : 384 Message(q) |==========|==========| ... |==========|===== : | 385 section : 386 <----------> m_max 387 N bit 388 ___________________________________________________________________ 389 l_max = ceil(m_max/N), 390 q*N <= L. 391 Figure 3: Key meshing with no master key 393 During the processing of the input message M with the length m in 394 some encryption mode that uses ACPKM key transformation of the key K 395 the message is divided into l = ceil(m/N) parts (denoted as M = M_1 | 396 M_2 | ... | M_l, where M_i is in V_N for i = 1, 2, ... , l-1 and M_l 397 is in V_r, r <= N). The first section is processed with the initial 398 key K^1 = K. To process the (i+1)-th section the K^{i+1} key value 399 is calculated using ACPKM transformation as follows: 401 K^{i+1} = ACPKM(K^i) = MSB_k(E_{K^i}(W_1) | ... | E_{K^i}(W_J)), 403 where J = ceil(k/n), W_t = phi_c(D_t) for any t in {1, ... ,J} and 404 D_1, D_2, ... , D_J are in V_n and are calculated as follows: 406 D_1 | D_2 | ... | D_J = MSB_{J*n}(D), 408 where D is the following constant in V_{1024}: 410 D = ( F3 | 74 | E9 | 23 | FE | AA | D6 | DD 411 | 98 | B4 | B6 | 3D | 57 | 8B | 35 | AC 412 | A9 | 0F | D7 | 31 | E4 | 1D | 64 | 5E 413 | 40 | 8C | 87 | 87 | 28 | CC | 76 | 90 414 | 37 | 76 | 49 | 9F | 7D | F3 | 3B | 06 415 | 92 | 21 | 7B | 06 | 37 | BA | 9F | B4 416 | F2 | 71 | 90 | 3F | 3C | F6 | FD | 1D 417 | 70 | BB | BB | 88 | E7 | F4 | 1B | 76 418 | 7E | 44 | F9 | 0E | 46 | 91 | 5B | 57 419 | 00 | BC | 13 | 45 | BE | 0D | BD | C7 420 | 61 | 38 | 19 | 3C | 41 | 30 | 86 | 82 421 | 1A | A0 | 45 | 79 | 23 | 4C | 4C | F3 422 | 64 | F2 | 6A | CC | EA | 48 | CB | B4 423 | 0C | B9 | A9 | 28 | C3 | B9 | 65 | CD 424 | 9A | CA | 60 | FB | 9C | A4 | 62 | C7 425 | 22 | C0 | 6C | E2 | 4A | C7 | FB | 5B). 427 N o t e : The constant D is such that phi_c(D_1), ... , phi_c(D_J) 428 are pairwise different for any allowed n, k, c values. 430 N o t e : The constant D is such that D = 431 sha512(streebog512(0^1024)) | sha512(streebog512(1^1024)), where 432 sha512 is a hash function with 512-bit output corresponding to the 433 algorithm SHA-512 [SHA-512], streebog512 is a hash function with 434 512-bit output, corresponding to the algorithm GOST R 34.11-2012 435 [GOST3411-2012], [RFC6986]. 437 5.1.2. CTR-ACPKM Encryption Mode 439 This section defines a CTR-ACPKM encryption mode that uses internal 440 ACPKM re-keying mechanism for the periodical key transformation. 442 The CTR-ACPKM mode can be considered as the extended by the ACPKM re- 443 keying mechanism basic encryption mode CTR (see [MODES]). 445 The CTR-ACPKM encryption mode can be used with the following 446 parameters: 448 o 64 <= n <= 512; 450 o 128 <= k <= 512; 452 o the number of bits c in a specific part of the block to be 453 incremented is such that 32 <= c <= 3/4 n. 455 The CTR-ACPKM mode encryption and decryption procedures are defined 456 as follows: 458 +----------------------------------------------------------------+ 459 | CTR-ACPKM-Encrypt(N, K, ICN, P) | 460 |----------------------------------------------------------------| 461 | Input: | 462 | - Section size N, | 463 | - key K, | 464 | - initial counter nonce ICN in V_{n-c}, | 465 | - plaintext P = P_1 | ... | P_b, |P| < n * 2^{c-1}. | 466 | Output: | 467 | - Ciphertext C. | 468 |----------------------------------------------------------------| 469 | 1. CTR_1 = ICN | 0^c | 470 | 2. For j = 2, 3, ... , b do | 471 | CTR_{j} = Inc_c(CTR_{j-1}) | 472 | 3. K^1 = K | 473 | 4. For i = 2, 3, ... , ceil(|P|/N) | 474 | K^i = ACPKM(K^{i-1}) | 475 | 5. For j = 1, 2, ... , b do | 476 | i = ceil(j*n / N), | 477 | G_j = E_{K^i}(CTR_j) | 478 | 6. C = P (xor) MSB_{|P|}(G_1 | ... | G_b) | 479 | 7. Return C | 480 +----------------------------------------------------------------+ 482 +----------------------------------------------------------------+ 483 | CTR-ACPKM-Decrypt(N, K, ICN, C) | 484 |----------------------------------------------------------------| 485 | Input: | 486 | - Section size N, | 487 | - key K, | 488 | - initial counter nonce ICN in V_{n-c}, | 489 | - ciphertext C = C_1 | ... | C_b, |C| < n * 2^{c-1}. | 490 | Output: | 491 | - Plaintext P. | 492 |----------------------------------------------------------------| 493 | 1. Return CTR-ACPKM-Encrypt(N, K, ICN, C) | 494 +----------------------------------------------------------------+ 496 The initial counter nonce ICN value for each message that is 497 encrypted under the given key must be chosen in a unique manner. 499 The message size m MUST NOT exceed n * 2^{c-1} bits. 501 5.1.3. GCM-ACPKM Encryption Mode 503 This section defines a GCM-ACPKM encryption mode that uses internal 504 ACPKM re-keying mechanism for the periodical key transformation. 506 The GCM-ACPKM mode can be considered as the extended by the ACPKM re- 507 keying mechanism basic encryption mode GCM (see [GCM]). 509 The GCM-ACPKM encryption mode can be used with the following 510 parameters: 512 o n in {128, 256}; 514 o 128 <= k <= 512; 516 o the number of bits c in a specific part of the block to be 517 incremented is such that 32 <= c <= 3/4 n; 519 o authentication tag length t. 521 The GCM-ACPKM mode encryption and decryption procedures are defined 522 as follows: 524 +--------------------------------------------------------------------+ 525 | GHASH(X, H) | 526 |--------------------------------------------------------------------| 527 | Input: | 528 | - Bit string X = X_1 | ... | X_m, X_i in V_n for i in 1, ... , m. | 529 | Output: | 530 | - Block GHASH(X, H) in V_n. | 531 |--------------------------------------------------------------------| 532 | 1. Y_0 = 0^n | 533 | 2. For i = 1, ... , m do | 534 | Y_i = (Y_{i-1} (xor) X_i) * H | 535 | 3. Return Y_m | 536 +--------------------------------------------------------------------+ 538 +--------------------------------------------------------------------+ 539 | GCTR(N, K, ICB, X) | 540 |--------------------------------------------------------------------| 541 | Input: | 542 | - Section size N, | 543 | - key K, | 544 | - initial counter block ICB, | 545 | - X = X_1 | ... | X_b, X_i in V_n for i = 1, ... , b-1 and | 546 | X_b in V_r, where r <= n. | 547 | Output: | 548 | - Y in V_{|X|}. | 549 |--------------------------------------------------------------------| 550 | 1. If X in V_0 then return Y, where Y in V_0 | 551 | 2. GCTR_1 = ICB | 552 | 3. For i = 2, ... , b do | 553 | GCTR_i = Inc_c(GCTR_{i-1}) | 554 | 4. K^1 = K | 555 | 5. For j = 2, ... , ceil(l*n / N) | 556 | K^j = ACPKM(K^{j-1}) | 557 | 6. For i = 1, ... , b do | 558 | j = ceil(i*n / N), | 559 | G_i = E_{K_j}(GCTR_i) | 560 | 7. Y = X (xor) MSB_{|X|}(G_1 | ... | G_b) | 561 | 8. Return Y. | 562 +--------------------------------------------------------------------+ 564 +--------------------------------------------------------------------+ 565 | GCM-ACPKM-Encrypt(N, K, IV, P, A) | 566 |--------------------------------------------------------------------| 567 | Input: | 568 | - Section size N, | 569 | - key K, | 570 | - initial counter nonce ICN in V_{n-c}, | 571 | - plaintext P, |P| <= n*(2^{c-1} - 2), P = P_1 | ... | P_b, | 572 | - additional authenticated data A. | 573 | Output: | 574 | - Ciphertext C, | 575 | - authentication tag T. | 576 |--------------------------------------------------------------------| 577 | 1. H = E_{K}(0^n) | 578 | 2. If c = 32, then ICB_0 = ICN | 0^31 | 1 | 579 | if c!= 32, then s = n * ceil(|ICN| / n) - |ICN|, | 580 | ICB_0 = GHASH(ICN | 0^{s+n-64} | Vec_64(|ICN|), H) | 581 | 3. C = GCTR(N, K, Inc_32(ICB_0), P) | 582 | 4. u = n*ceil(|C| / n) - |C| | 583 | v = n*ceil(|A| / n) - |A| | 584 | 5. S = GHASH(A | 0^v | C | 0^u | 0^{n-128} | Vec_64(|A|) | | 585 | | Vec_64(|C|), H) | 586 | 6. T = MSB_t(E_{K}(ICB_0) (xor) S) | 587 | 7. Return C | T | 588 +--------------------------------------------------------------------+ 590 +--------------------------------------------------------------------+ 591 | GCM-ACPKM-Decrypt(N, K, IV, A, C, T) | 592 |--------------------------------------------------------------------| 593 | Input: | 594 | - Section size N, | 595 | - key K, | 596 | - initial counter block ICB, | 597 | - additional authenticated data A. | 598 | - ciphertext C, |C| <= n*(2^{c-1} - 2), C = C_1 | ... | C_b, | 599 | - authentication tag T | 600 | Output: | 601 | - Plaintext P or FAIL. | 602 |--------------------------------------------------------------------| 603 | 1. H = E_{K}(0^n) | 604 | 2. If c = 32, then ICB_0 = ICN | 0^31 | 1 | 605 | if c!= 32, then s = n*ceil(|ICN|/n)-|ICN|, | 606 | ICB_0 = GHASH(ICN | 0^{s+n-64} | Vec_64(|ICN|), H) | 607 | 3. P = GCTR(N, K, Inc_32(ICB_0), C) | 608 | 4. u = n*ceil(|C| / n)-|C| | 609 | v = n*ceil(|A| / n)-|A| | 610 | 5. S = GHASH(A | 0^v | C | 0^u | 0^{n-128} | Vec_64(|A|) | | 611 | | Vec_64(|C|), H) | 612 | 6. T' = MSB_t(E_{K}(ICB_0) (xor) S) | 613 | 7. If T = T' then return P; else return FAIL | 614 +--------------------------------------------------------------------+ 616 The * operation on (pairs of) the 2^n possible blocks corresponds to 617 the multiplication operation for the binary Galois (finite) field of 618 2^n elements defined by the polynomial f as follows (by analogy with 619 [GCM]): 621 n = 128: f = a^128 + a^7 + a^2 + a^1 + 1. 623 n = 256: f = a^256 + a^10 + a^5 + a^2 + 1. 625 The initial vector IV value for each message that is encrypted under 626 the given key must be chosen in a unique manner. 628 The message size m MUST NOT exceed n*(2^{c-1} - 2) bits. 630 The key for computing values E_{K}(ICB_0) and H is not updated and is 631 equal to the initial key K. 633 5.2. Constructions that Require Master Key 635 This section describes the block cipher modes that uses the ACPKM- 636 Master re-keying mechanism (described in Section 5.2.1), which use 637 the initial key K as a master key K*, so K is never used directly for 638 the data processing but is used for key derivation. 640 5.2.1. ACPKM-Master Key Generation from the Master Key 642 This section defines periodical key transformation with master key K* 643 which is called ACPKM-Master re-keying mechanism. This mechanism can 644 be applied to one of the basic encryption modes (CTR, GCM, CBC, CFB, 645 OFB, OMAC encryption modes) for getting an extension of this 646 encryption mode that uses periodical key transformation with master 647 key. This extension can be considered as a new encryption mode. 649 Additional parameters that defines the functioning of basic 650 encryption modes with the ACPKM-Master re-keying mechanism are the 651 section size N and change frequency T* of the key K*. The values of 652 N and T* are measured in bits and are fixed within a specific 653 protocol based on the requirements of the system capacity and key 654 lifetime (some recommendations on choosing N and T* will be provided 655 in Section 7). The section size N MUST be divisible by the block 656 size n. The key frequency T* MUST be divisible by n. 658 The main idea behind internal re-keying with master key is presented 659 in Fig.4: 661 Lifetime of a key = L, 662 change frequency T*, 663 section size N, 664 maximum message size = m_max. 665 _______________________________________________________________________________________ 667 ACPKM ACPKM 668 K*_1 = K*-------------> K*_2 ---------...---------> K*_l_max 669 ___|___ ___|___ ___|___ 670 | | | | | | 671 v ... v v ... v v ... v 672 K[1] K[t] K[t+1] K[2t] K[(l_max-1)t+1] K[l_max*t] 673 | | | | | | 674 | | | | | | 675 v v v v v v 676 Message(1)||========|...|========||========|...|========||...||========|...|== : || 677 Message(2)||========|...|========||========|...|========||...||========|...|======: || 678 ... || | | || | | || || | | : || 679 Message(q)||========|...|========||==== |...| ||...|| |...| : || 680 section : 681 <--------> : 682 N bit m_max 683 _______________________________________________________________________________________ 684 |K[i]| = d, 685 t = T*/d, 686 l_max = ceil(m_max/N), 687 q*N <= L. 688 Figure 4: Key meshing with master key 690 During the processing of the input message M with the length m in 691 some encryption mode that uses ACPKM-Master key transformation with 692 the master key K* and key frequency T* the message M is divided into 693 l = ceil(m/N) parts (denoted as M = M_1 | M_2 | ... | M_l, where M_i 694 is in V_N for i in {1, 2, ... , l-1} and M_l is in V_r, r <= N). The 695 j-th section is processed with the key material K[j], j in {1, ... 696 ,l}, |K[j]| = d, that has been calculated with the ACPKM-Master 697 algorithm as follows: 699 IV = 1^{n/2}, 701 K[1] | ... | K[l] = ACPKM-Master(T*, K*, d*l) = CTR-ACPKM-Encrypt 702 (T*, K*, IV, 0^{d*l}). 704 5.2.2. CTR Mode Key Meshing 706 This section defines a CTR-ACPKM-Master encryption mode that uses 707 internal ACPKM-Master re-keying mechanism for the periodical key 708 transformation. 710 The CTR-ACPKM-Master encryption mode can be considered as the 711 extended by the ACPKM-Master re-keying mechanism basic encryption 712 mode CTR (see [MODES]). 714 The CTR-ACPKM-Master encryption mode can be used with the following 715 parameters: 717 o 64 <= n <= 512; 719 o 128 <= k <= 512; 721 o the number of bits c in a specific part of the block to be 722 incremented is such that 32 <= c <= 3/4 n. 724 The key material K[j] that is used for one section processing is 725 equal to K^j, |K^j| = k bits. 727 The CTR-ACPKM-Master mode encryption and decryption procedures are 728 defined as follows: 730 +----------------------------------------------------------------+ 731 | CTR-ACPKM-Master-Encrypt(N, K*, T*, ICN, P) | 732 |----------------------------------------------------------------| 733 | Input: | 734 | - Section size N, | 735 | - master key K*, | 736 | - change frequency T*, | 737 | - initial counter nonce ICN in V_{n-c}, | 738 | - plaintext P = P_1 | ... | P_b, |P| <= 2^{n/2-1}*n*N / k. | 739 | Output: | 740 | - Ciphertext C. | 741 |----------------------------------------------------------------| 742 | 1. CTR_1 = ICN | 0^c | 743 | 2. For j = 2, 3, ... , b do | 744 | CTR_{j} = Inc_c(CTR_{j-1}) | 745 | 3. l = ceil(b*n / N) | 746 | 4. K^1 | ... | K^l = ACPKM-Master(T*, K*, k*l) | 747 | 5. For j = 1, 2, ... , b do | 748 | i = ceil(j*n / N), | 749 | G_j = E_{K^i}(CTR_j) | 750 | 6. C = P (xor) MSB_{|P|}(G_1 | ... |G_b) | 751 | 7. Return C | 752 |----------------------------------------------------------------+ 754 +----------------------------------------------------------------+ 755 | CTR-ACPKM-Master-Decrypt(N, K*, T*, ICN, C) | 756 |----------------------------------------------------------------| 757 | Input: | 758 | - Section size N, | 759 | - master key K*, | 760 | - change frequency T*, | 761 | - initial counter nonce ICN in V_{n-c}, | 762 | - ciphertext C = C_1 | ... | C_b, |C| <= 2^{n/2-1}*n*N / k. | 763 | Output: | 764 | - Plaintext P. | 765 |----------------------------------------------------------------| 766 | 1. Return CTR-ACPKM-Master-Encrypt(N, K*, T*, ICN, C) | 767 +----------------------------------------------------------------+ 769 The initial counter nonce ICN value for each message that is 770 encrypted under the given key must be chosen in a unique manner. The 771 counter (CTR_{i+1}) value does not change during key transformation. 773 The message size m MUST NOT exceed (2^{n/2-1}*n*N / k) bits. 775 5.2.3. GCM Mode Key Meshing 777 This section defines a GCM-ACPKM-Master encryption mode that uses 778 internal ACPKM-Master re-keying mechanism for the periodical key 779 transformation. 781 The GCM-ACPKM-Master encryption mode can be considered as the 782 extended by the ACPKM-Master re-keying mechanism basic encryption 783 mode GCM (see [GCM]). 785 The GCM-ACPKM-Master encryption mode can be used with the following 786 parameters: 788 o n in {128, 256}; 790 o 128 <= k <= 512; 792 o the number of bits c in a specific part of the block to be 793 incremented is such that 32 <= c <= 3/4 n; 795 o authentication tag length t. 797 The key material K[j] that is used for one section processing is 798 equal to K^j, |K^j| = k bits, that is calculated as follows: 800 K^1 | ... | K^j | ... | K^l = ACPKM-Master(T*, K*, k*l). 802 The GCM-ACPKM-Master mode encryption and decryption procedures are 803 defined as follows: 805 +--------------------------------------------------------------------+ 806 | GHASH(X, H) | 807 |--------------------------------------------------------------------| 808 | Input: | 809 | - Bit string X = X_1 | ... | X_m, X_i in V_n for i in {1, ... , m}| 810 | Output: | 811 | - Block GHASH(X, H) in V_n | 812 |--------------------------------------------------------------------| 813 | 1. Y_0 = 0^n | 814 | 2. For i = 1, ... , m do | 815 | Y_i = (Y_{i-1} (xor) X_i)*H | 816 | 3. Return Y_m | 817 +--------------------------------------------------------------------+ 819 +--------------------------------------------------------------------+ 820 | GCTR(N, K*, T*, ICB, X) | 821 |--------------------------------------------------------------------| 822 | Input: | 823 | - Section size N, | 824 | - master key K*, | 825 | - change frequency T*, | 826 | - initial counter block ICB, | 827 | - X = X_1 | ... | X_b, X_i in V_n for i = 1, ... , b-1 and | 828 | X_b in V_r, where r <= n. | 829 | Output: | 830 | - Y in V_{|X|}. | 831 |--------------------------------------------------------------------| 832 | 1. If X in V_0 then return Y, where Y in V_0 | 833 | 2. GCTR_1 = ICB | 834 | 3. For i = 2, ... , b do | 835 | GCTR_i = Inc_c(GCTR_{i-1}) | 836 | 4. l = ceil(b*n / N) | 837 | 5. K^1 | ... | K^l = ACPKM-Master(T*, K*, k*l) | 838 | 6. For j = 1, ... , b do | 839 | i = ceil(j*n / N), | 840 | G_j = E_{K^i}(GCTR_j) | 841 | 7. Y = X (xor) MSB_{|X|}(G_1 | ... | G_b) | 842 | 8. Return Y | 843 +--------------------------------------------------------------------+ 845 +--------------------------------------------------------------------+ 846 | GCM-ACPKM-Master-Encrypt(N, K*, T*, IV, P, A) | 847 |--------------------------------------------------------------------| 848 | Input: | 849 | - Section size N, | 850 | - master key K*, | 851 | - change frequency T*, | 852 | - initial counter nonce ICN in V_{n-c}, | 853 | - plaintext P, |P| <= n*(2^{c-1} - 2). | 854 | - additional authenticated data A. | 855 | Output: | 856 | - Ciphertext C, | 857 | - authentication tag T. | 858 |--------------------------------------------------------------------| 859 | 1. K^1 = ACPKM-Master(T*, K*, k) | 860 | 2. H = E_{K^1}(0^n) | 861 | 3. If c = 32, then ICB_0 = ICN | 0^31 | 1 | 862 | if c!= 32, then s = n*ceil(|ICN|/n) - |ICN|, | 863 | ICB_0 = GHASH(ICN | 0^{s+n-64} | Vec_64(|ICN|), H) | 864 | 4. C = GCTR(N, K*, T*, Inc_32(J_0), P) | 865 | 5. u = n*ceil(|C| / n) - |C| | 866 | v = n*ceil(|A| / n) - |A| | 867 | 6. S = GHASH(A | 0^v | C | 0^u | 0^{n-128} | Vec_64(|A|) | | 868 | | Vec_64(|C|), H) | 869 | 7. T = MSB_t(E_{K^1}(J_0) (xor) S) | 870 | 8. Return C | T | 871 +--------------------------------------------------------------------+ 873 +--------------------------------------------------------------------+ 874 | GCM-ACPKM-Master-Decrypt(N, K*, T*, IV, A, C, T) | 875 |--------------------------------------------------------------------| 876 | Input: | 877 | - Section size N, | 878 | - master key K*, | 879 | - change frequency T*, | 880 | - initial counter nonce ICN in V_{n-c}, | 881 | - additional authenticated data A. | 882 | - ciphertext C, |C| <= n*(2^{c-1} - 2), | 883 | - authentication tag T, | 884 | Output: | 885 | - Plaintext P or FAIL. | 886 |--------------------------------------------------------------------| 887 | 1. K^1 = ACPKM-Master(T*, K*, k) | 888 | 2. H = E_{K^1}(0^n) | 889 | 3. If c = 32, then ICB_0 = ICN | 0^31 | 1 | 890 | if c!= 32, then s = n*ceil(|ICN| / n) - |ICN|, | 891 | ICB_0 = GHASH(ICN | 0^{s+n-64} | Vec_64(|ICN|), H) | 892 | 4. P = GCTR(N, K*, T*, Inc_32(J_0), C) | 893 | 5. u = n*ceil(|C| / n) - |C| | 894 | v = n*ceil(|A| / n) - |A| | 895 | 6. S = GHASH(A | 0^v | C | 0^u | 0^{n-128} | Vec_64(|A|) | | 896 | | Vec_64(|C|), H) | 897 | 7. T' = MSB_t(E_{K^1}(ICB_0) (xor) S) | 898 | 8. IF T = T' then return P; else return FAIL. | 899 +--------------------------------------------------------------------+ 901 The * operation on (pairs of) the 2^n possible blocks corresponds to 902 the multiplication operation for the binary Galois (finite) field of 903 2^n elements defined by the polynomial f as follows (by analogy with 904 [GCM]): 906 n = 128: f = a^128 + a^7 + a^2 + a^1 + 1. 908 n = 256: f = a^256 + a^10 + a^5 + a^2 + 1. 910 The initial vector IV value for each message that is encrypted under 911 the given key must be chosen in a unique manner. 913 The message size m MUST NOT exceed (2^{n/2-1}*n*N / k) bits. 915 5.2.4. CBC Mode Key Meshing 917 This section defines a CBC-ACPKM-Master encryption mode that uses 918 internal ACPKM-Master re-keying mechanism for the periodical key 919 transformation. 921 The CBC-ACPKM-Master encryption mode can be considered as the 922 extended by the ACPKM-Master re-keying mechanism basic encryption 923 mode CBC (see [MODES]). 925 The CBC-ACPKM-Master encryption mode can be used with the following 926 parameters: 928 o 64 <= n <= 512; 930 o 128 <= k <= 512. 932 In the specification of the CBC-ACPKM-Master mode the plaintext and 933 ciphertext must be a sequence of one or more complete data blocks. 934 If the data string to be encrypted does not initially satisfy this 935 property, then it MUST be padded to form complete data blocks. The 936 padding methods are outside the scope of this document. An example 937 of a padding method can be found in Appendix A of [MODES]. 939 The key material K[j] that is used for one section processing is 940 equal to K^j, |K^j| = k bits. 942 We will denote by D_{K} the decryption function which is a 943 permutation inverse to the E_{K}. 945 The CBC-ACPKM-Master mode encryption and decryption procedures are 946 defined as follows: 948 +----------------------------------------------------------------+ 949 | CBC-ACPKM-Master-Encrypt(N, K*, T*, IV, P) | 950 |----------------------------------------------------------------| 951 | Input: | 952 | - Section size N, | 953 | - master key K*, | 954 | - change frequency T*, | 955 | - initialization vector IV in V_n, | 956 | - plaintext P = P_1 | ... | P_b, |P| <= 2^{n/2-1}*n*N / k, | 957 | |P_b| = n. | 958 | Output: | 959 | - Ciphertext C. | 960 |----------------------------------------------------------------| 961 | 1. l = ceil(b*n/N) | 962 | 2. K^1 | ... | K^l = ACPKM-Master(T*, K*, k*l) | 963 | 3. C_0 = IV | 964 | 4. For j = 1, 2, ... , b do | 965 | i = ceil(j*n / N), | 966 | C_j = E_{K^i}(P_j (xor) C_{j-1}) | 967 | 5. Return C = C_1 | ... | C_b | 968 |----------------------------------------------------------------+ 970 +----------------------------------------------------------------+ 971 | CBC-ACPKM-Master-Decrypt(N, K*, T*, IV, C) | 972 |----------------------------------------------------------------| 973 | Input: | 974 | - Section size N, | 975 | - master key K*, | 976 | - change frequency T*, | 977 | - initialization vector IV in V_n, | 978 | - ciphertext C = C_1 | ... | C_b, |C| <= 2^{n/2-1}*n*N/k, | 979 | |C_b| = n. | 980 | Output: | 981 | - Plaintext P. | 982 |----------------------------------------------------------------| 983 | 1. l = ceil(b*n / N) | 984 | 2. K^1 | ... | K^l = ACPKM-Master(T*, K*, k*l) | 985 | 3. C_0 = IV | 986 | 4. For j = 1, 2, ... , b do | 987 | i = ceil(j*n/N) | 988 | P_j = D_{K^i}(C_j) (xor) C_{j-1} | 989 | 5. Return P = P_1 | ... | P_b | 990 +----------------------------------------------------------------+ 992 The initialization vector IV for each message that is encrypted under 993 the given key need not to be secret, but must be unpredictable. 995 The message size m MUST NOT exceed (2^{n/2-1}*n*N / k) bits. 997 5.2.5. CFB Mode Key Meshing 999 This section defines a CFB-ACPKM-Master encryption mode that uses 1000 internal ACPKM-Master re-keying mechanism for the periodical key 1001 transformation. 1003 The CFB-ACPKM-Master encryption mode can be considered as the 1004 extended by the ACPKM-Master re-keying mechanism basic encryption 1005 mode CFB (see [MODES]). 1007 The CFB-ACPKM-Master encryption mode can be used with the following 1008 parameters: 1010 o 64 <= n <= 512; 1012 o 128 <= k <= 512. 1014 The key material K[j] that is used for one section processing is 1015 equal to K^j, |K^j| = k bits. 1017 The CFB-ACPKM-Master mode encryption and decryption procedures are 1018 defined as follows: 1020 +----------------------------------------------------------------+ 1021 | CFB-ACPKM-Master-Encrypt(N, K*, T*, IV, P) | 1022 |----------------------------------------------------------------| 1023 | Input: | 1024 | - Section size N, | 1025 | - master key K*, | 1026 | - change frequency T*, | 1027 | - initialization vector IV in V_n, | 1028 | - plaintext P = P_1 | ... | P_b, |P| <= 2^{n/2-1}*n*N / k. | 1029 | Output: | 1030 | - Ciphertext C. | 1031 |----------------------------------------------------------------| 1032 | 1. l = ceil(b*n / N) | 1033 | 2. K^1 | ... | K^l = ACPKM-Master(T*, K*, k*l) | 1034 | 3. C_0 = IV | 1035 | 4. For j = 1, 2, ... , b do | 1036 | i = ceil(j*n / N) | 1037 | C_j = E_{K^i}(C_{j-1}) (xor) P_j | 1038 | 5. Return C = C_1 | ... | C_b. | 1039 |----------------------------------------------------------------+ 1041 +----------------------------------------------------------------+ 1042 | CFB-ACPKM-Master-Decrypt(N, K*, T*, IV, C#) | 1043 |----------------------------------------------------------------| 1044 | Input: | 1045 | - Section size N, | 1046 | - master key K*, | 1047 | - change frequency T*, | 1048 | - initialization vector IV in V_n, | 1049 | - ciphertext C = C_1 | ... | C_b, |C| <= 2^{n/2-1}*n*N / k. | 1050 | Output: | 1051 | - Plaintext P. | 1052 |----------------------------------------------------------------| 1053 | 1. l = ceil(b*n / N) | 1054 | 2. K^1 | ... | K^l = ACPKM-Master(T*, K*, k*l) | 1055 | 3. C_0 = IV | 1056 | 4. For j = 1, 2, ... , b do | 1057 | i = ceil(j*n / N), | 1058 | P_j = E_{K^i}(C_{j-1}) (xor) С_j | 1059 | 5. Return P = P_1 | ... | P_b | 1060 +----------------------------------------------------------------+ 1062 The initialization vector IV for each message that is encrypted under 1063 the given key need not to be secret, but must be unpredictable. 1065 The message size m MUST NOT exceed 2^{n/2-1}*n*N/k bits. 1067 5.2.6. OFB Mode Key Meshing 1069 This section defines an OFB-ACPKM-Master encryption mode that uses 1070 internal ACPKM-Master re-keying mechanism for the periodical key 1071 transformation. 1073 The OFB-ACPKM-Master encryption mode can be considered as the 1074 extended by the ACPKM-Master re-keying mechanism basic encryption 1075 mode OFB (see [MODES]). 1077 The OFB-ACPKM-Master encryption mode can be used with the following 1078 parameters: 1080 o 64 <= n <= 512; 1082 o 128 <= k <= 512. 1084 The key material K[j] used for one section processing is equal to 1085 K^j, |K^j| = k bits. 1087 The OFB-ACPKM-Master mode encryption and decryption procedures are 1088 defined as follows: 1090 +----------------------------------------------------------------+ 1091 | OFB-ACPKM-Master-Encrypt(N, K*, T*, IV, P) | 1092 |----------------------------------------------------------------| 1093 | Input: | 1094 | - Section size N, | 1095 | - master key K*, | 1096 | - change frequency T*, | 1097 | - initialization vector IV in V_n, | 1098 | - plaintext P = P_1 | ... | P_b, |P| <= 2^{n/2-1}*n*N / k. | 1099 | Output: | 1100 | - Ciphertext C. | 1101 |----------------------------------------------------------------| 1102 | 1. l = ceil(b*n / N) | 1103 | 2. K^1 | ... | K^l = ACPKM-Master(T*, K*, k*l) | 1104 | 3. G_0 = IV | 1105 | 4. For j = 1, 2, ... , b do | 1106 | i = ceil(j*n / N), | 1107 | G_j = E_{K_i}(G_{j-1}) | 1108 | 5. Return C = P (xor) MSB_{|P|}(G_1 | ... | G_b) | 1109 |----------------------------------------------------------------+ 1111 +----------------------------------------------------------------+ 1112 | OFB-ACPKM-Master-Decrypt(N, K*, T*, IV, C) | 1113 |----------------------------------------------------------------| 1114 | Input: | 1115 | - Section size N, | 1116 | - master key K*, | 1117 | - change frequency T*, | 1118 | - initialization vector IV in V_n, | 1119 | - ciphertext C = C_1 | ... | C_b, |C| <= 2^{n/2-1}*n*N / k. | 1120 | Output: | 1121 | - Plaintext P. | 1122 |----------------------------------------------------------------| 1123 | 1. Return OFB-ACPKM-Master-Encrypt(N, K*, T*, IV, C) | 1124 +----------------------------------------------------------------+ 1126 The initialization vector IV for each message that is encrypted under 1127 the given key need not be unpredictable, but it must be a nonce that 1128 is unique to each execution of the encryption operation. 1130 The message size m MUST NOT exceed 2^{n/2-1}*n*N / k bits. 1132 5.2.7. OMAC Mode Key Meshing 1134 This section defines an OMAC-ACPKM-Master message authentication code 1135 calculation mode that uses internal ACPKM-Master re-keying mechanism 1136 for the periodical key transformation. 1138 The OMAC-ACPKM-Master encryption mode can be considered as the 1139 extended by the ACPKM-Master re-keying mechanism basic message 1140 authentication code calculation mode OMAC (see [RFC4493]). 1142 The OMAC-ACPKM-Master message authentication code calculation mode 1143 can be used with the following parameters: 1145 o n in {64, 128, 256}; 1147 o 128 <= k <= 512. 1149 The key material K[j] that is used for one section processing is 1150 equal to K^j | K^j_1, where |K^j| = k and |K^j_1| = n. 1152 The following is a specification of the subkey generation process of 1153 OMAC: 1155 +---------------------------------------------------------------------+ 1156 | Generate_Subkey(K, r) | 1157 |---------------------------------------------------------------------| 1158 | Input: | 1159 | - Key K, | 1160 | Output: | 1161 | - Key [K]. | 1162 |---------------------------------------------------------------------| 1163 | 1. If r = n then return K | 1164 | 2. If r < n then | 1165 | if MSB_1(K1) = 0 | 1166 | return K1 << 1 | 1167 | else | 1168 | return (K1 << 1) (xor) R_n | 1169 | | 1170 +---------------------------------------------------------------------+ 1172 Where R_n takes the following values: 1174 o n = 64: R_{64} = 0^{59} | 11011; 1176 o n = 128: R_{128} = 0^{120} | 10000111; 1178 o n = 256: R_{256} = 0^{145} | 10000100101. 1180 The OMAC-ACPKM-Master message authentication code calculation mode is 1181 defined as follows: 1183 +---------------------------------------------------------------------+ 1184 | OMAC-ACPKM-Master(K*, N, T*, M) | 1185 |---------------------------------------------------------------------| 1186 | Input: | 1187 | - Section size N, | 1188 | - master key K*, | 1189 | - key frequency T*, | 1190 | - plaintext M = M_1 | ... | M_b, |M| <= 2^{n/2}*n^2*N / (k + n). | 1191 | Output: | 1192 | - message authentication code T. | 1193 |---------------------------------------------------------------------| 1194 | 1. C_0 = 0^n | 1195 | 2. l = ceil(b*n / N) | 1196 | 3. K^1 | K^1_1 | ... | K^l | K^l_1 = ACPKM-Master(T*, K*, (k+n)*l) | 1197 | 4. For j = 1, 2, ... , b-1 do | 1198 | i = ceil(j*n / N), | 1199 | C_j = E_{K^i}(M_j (xor) C_{j-1}) | 1200 | 5. [K] = Generate_Subkey(K^l_1, |M_b|) | 1201 | 6. If |M_b| = n then M*_b = M_b | 1202 | else M*_b = M_b | 1 | 0^{n - 1 -|M_b|} | 1203 | 7. T = E_{K^l}(M*_b (xor) C_{b-1} (xor) [K]) | 1204 | 8. Return T | 1205 +---------------------------------------------------------------------+ 1207 The message size m MUST NOT exceed 2^{n/2}*n^2*N / (k + n) bits. 1209 6. Joint Usage of External and Internal Re-keying 1211 Any mechanism described in Section 4 can be used with any mechanism 1212 described in Section 5. 1214 7. Security Considerations 1216 7.1. Principles of Choice of Constructions and Security Parameters 1218 External re-keying mechanism is RECOMMENDED to be used in protocols 1219 that process pretty small messages (e.g. TLS). 1221 Internal re-keying mechanism is RECOMMENDED to be used in protocols 1222 that can process large messages (e.g. IPSec). 1224 For the protocols that process messages of different lengths it is 1225 RECOMMENDED to use joint methods described in Section 6. 1227 7.2. Requirements For Base Primitives 1229 Re-keying should be used to increase "a priori" security properties 1230 of ciphers in hoslile environments (e.g. with side-channel 1231 adversaries). If some non-negligible attacks are known for a cipher, 1232 it MUST NOT be used. So re-keying can not be used as a patch for 1233 vulnerable ciphers. Base cipher properties must be well analyzed, 1234 because security of re-keying mechanisms is based on security of a 1235 block cipher as a pseudorandom function. 1237 8. References 1239 8.1. Normative References 1241 [GCM] McGrew, D. and J. Viega, "The Galois/Counter Mode of 1242 Operation (GCM)", Submission to NIST 1243 http://csrc.nist.gov/CryptoToolkit/modes/proposedmodes/ 1244 gcm/gcm-spec.pdf, January 2004. 1246 [GOST3411-2012] 1247 Federal Agency on Technical Regulating and Metrology (In 1248 Russian), "Information technology. Cryptographic Data 1249 Security. Hashing function", GOST R 34.11-2012, 2012. 1251 [MODES] Dworkin, M., "Recommendation for Block Cipher Modes of 1252 Operation: Methods and Techniques", NIST Special 1253 Publication 800-38A, December 2001. 1255 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1256 Requirement Levels", BCP 14, RFC 2119, 1257 DOI 10.17487/RFC2119, March 1997, 1258 . 1260 [RFC4493] Song, JH., Poovendran, R., Lee, J., and T. Iwata, "The 1261 AES-CMAC Algorithm", RFC 4493, DOI 10.17487/RFC4493, June 1262 2006, . 1264 [RFC5869] Krawczyk, H. and P. Eronen, "HMAC-based Extract-and-Expand 1265 Key Derivation Function (HKDF)", RFC 5869, 1266 DOI 10.17487/RFC5869, May 2010, 1267 . 1269 [SHA-512] National Institute of Standards and Technology., "Secure 1270 Hash Standard", FIPS 180-2, August, with Change Notice 1 1271 dated February 2004 2002. 1273 [TLSDraft] 1274 Rescorla, E., "The Transport Layer Security (TLS) Protocol 1275 Version 1.3", 2017, . 1278 8.2. Informative References 1280 [AbBell] Michel Abdalla and Mihir Bellare, "Increasing the Lifetime 1281 of a Key: A Comparative Analysis of the Security of Re- 1282 keying Techniques", ASIACRYPT2000, LNCS 1976, pp. 546-559, 1283 2000. 1285 [BDJR] Bellare M., Desai A., Jokipii E., Rogaway P., "A concrete 1286 security treatment of symmetric encryption", In 1287 Proceedings of 38th Annual Symposium on Foundations of 1288 Computer Science (FOCS '97), pages 394-403. 97, 1997. 1290 [BL] Bhargavan K., Leurent G., "On the Practical (In-)Security 1291 of 64-bit Block Ciphers: Collision Attacks on HTTP over 1292 TLS and OpenVPN", Cryptology ePrint Archive Report 798, 1293 2016. 1295 [Matsui] Matsui M., "Linear Cryptanalysis Method for DES Cipher", 1296 Advanced in Cryptology- EUROCRYPT'93. Lect. Notes in Comp. 1297 Sci., Springer. V.765.P. 386-397, 1994. 1299 [RFC6986] Dolmatov, V., Ed. and A. Degtyarev, "GOST R 34.11-2012: 1300 Hash Function", RFC 6986, DOI 10.17487/RFC6986, August 1301 2013, . 1303 Appendix A. Test examples 1305 CTR-ACPKM mode with AES-256 1306 ********* 1307 c = 64 1308 k = 256 1309 N = 256 1310 n = 128 1312 W_0: 1313 F3 74 E9 23 FE AA D6 DD 98 B4 B6 3D 57 8B 35 AC 1315 W_1: 1316 A9 0F D7 31 E4 1D 64 5E C0 8C 87 87 28 CC 76 90 1318 Key K: 1319 88 99 AA BB CC DD EE FF 00 11 22 33 44 55 66 77 1320 FE DC BA 98 76 54 32 10 01 23 45 67 89 AB CD EF 1322 Plain text P: 1323 11 22 33 44 55 66 77 00 FF EE DD CC BB AA 99 88 1324 00 11 22 33 44 55 66 77 88 99 AA BB CC EE FF 0A 1325 11 22 33 44 55 66 77 88 99 AA BB CC EE FF 0A 00 1326 22 33 44 55 66 77 88 99 AA BB CC EE FF 0A 00 11 1327 33 44 55 66 77 88 99 AA BB CC EE FF 0A 00 11 22 1328 44 55 66 77 88 99 AA BB CC EE FF 0A 00 11 22 33 1329 55 66 77 88 99 AA BB CC EE FF 0A 00 11 22 33 44 1331 ICN: 1332 12 34 56 78 90 AB CE F0 1334 ACPKM's iteration 1 1336 Process block 1 1338 Input block (ctr) 1339 12 34 56 78 90 AB CE F0 00 00 00 00 00 00 00 00 1341 Output block (ctr) 1342 FD 7E F8 9A D9 7E A4 B8 8D B8 B5 1C 1C 9D 6D D0 1344 Plain text 1345 11 22 33 44 55 66 77 00 FF EE DD CC BB AA 99 88 1347 Cipher text 1348 EC 5C CB DE 8C 18 D3 B8 72 56 68 D0 A7 37 F4 58 1350 Process block 2 1352 Input block (ctr) 1353 12 34 56 78 90 AB CE F0 00 00 00 00 00 00 00 01 1355 Output block (ctr) 1356 19 98 C5 71 76 37 FB 17 11 E4 48 F0 0C 0D 60 B2 1358 Plain text 1359 00 11 22 33 44 55 66 77 88 99 AA BB CC EE FF 0A 1361 Cipher text 1362 19 89 E7 42 32 62 9D 60 99 7D E2 4B C0 E3 9F B8 1364 Updated key 1365 C6 C1 AF 82 3F 52 22 F8 97 CF F1 94 5D F7 21 9E 1366 21 6F 29 0C EF C4 C7 E6 DC C8 B7 DD 83 E0 AE 60 1367 ACPKM's iteration 2 1369 Process block 3 1370 Input block (ctr) 1371 12 34 56 78 90 AB CE F0 00 00 00 00 00 00 00 02 1373 Output block (ctr) 1374 92 B4 85 B5 B7 AD 3C 19 7E 53 92 32 13 9C 8E 7A 1376 Plain text 1377 11 22 33 44 55 66 77 88 99 AA BB CC EE FF 0A 00 1379 Cipher text 1380 83 96 B6 F1 E2 CB 4B 91 E7 F9 29 FE FD 63 84 7A 1382 Process block 4 1383 Input block (ctr) 1384 12 34 56 78 90 AB CE F0 00 00 00 00 00 00 00 03 1386 Output block (ctr) 1387 59 3A AA 96 7C E3 58 FB 1B 7E 41 A1 77 34 B1 4A 1389 Plain text 1390 22 33 44 55 66 77 88 99 AA BB CC EE FF 0A 00 11 1392 Cipher text 1393 7B 09 EE C3 1A 94 D0 62 B1 C5 8D 4F 88 3E B1 5B 1395 Updated key 1396 65 3E FA 18 0B 0E 68 01 6F 56 54 A5 F3 EE BC D5 1397 04 F1 1F E3 F1 7A 92 07 57 A8 82 BE A5 9E CA 16 1399 ACPKM's iteration 3 1400 Process block 5 1401 Input block (ctr) 1402 12 34 56 78 90 AB CE F0 00 00 00 00 00 00 00 04 1404 Output block (ctr) 1405 CE E5 51 54 12 2F 3F E7 8D 8E 86 21 C5 E5 47 12 1407 Plain text 1408 33 44 55 66 77 88 99 AA BB CC EE FF 0A 00 11 22 1410 Cipher text 1411 FD A1 04 32 65 A7 A6 4D 36 42 68 DE CF E5 56 30 1413 Process block 6 1414 Input block (ctr) 1415 12 34 56 78 90 AB CE F0 00 00 00 00 00 00 00 05 1417 Output block (ctr) 1418 DE D6 8F 03 FA C5 C5 B6 16 11 A3 78 2C 0D C1 EB 1420 Plain text 1421 44 55 66 77 88 99 AA BB CC EE FF 0A 00 11 22 33 1423 Cipher text 1424 9A 83 E9 74 72 5C 6F 0D DA FF 5C 72 2C 1C E3 D8 1426 Updated key 1427 C0 D5 50 26 4F DA CE 59 EF 80 9A 50 24 72 06 7D 1428 29 83 74 25 78 C9 60 4F E3 B8 88 4F F8 F5 E2 BD 1430 ACPKM's iteration 4 1431 Process block 7 1432 Input block (ctr) 1433 12 34 56 78 90 AB CE F0 00 00 00 00 00 00 00 06 1435 Output block (ctr) 1436 D9 23 A6 CD 8A 00 A1 55 90 09 EC 87 40 B9 D6 AB 1438 Plain text 1439 55 66 77 88 99 AA BB CC EE FF 0A 00 11 22 33 44 1441 Cipher text 1442 8C 45 D1 45 13 AA 1A 99 7E F6 E6 87 51 9B E5 EF 1444 Updated key 1445 6A A0 92 07 73 31 63 50 46 FA 48 1C 9C 98 7B 6B 1446 FC 99 48 DC BC AE AB C2 6D 46 E9 DD 43 F6 CA 56 1448 Encrypted src 1449 EC 5C CB DE 8C 18 D3 B8 72 56 68 D0 A7 37 F4 58 1450 19 89 E7 42 32 62 9D 60 99 7D E2 4B C0 E3 9F B8 1451 83 96 B6 F1 E2 CB 4B 91 E7 F9 29 FE FD 63 84 7A 1452 7B 09 EE C3 1A 94 D0 62 B1 C5 8D 4F 88 3E B1 5B 1453 FD A1 04 32 65 A7 A6 4D 36 42 68 DE CF E5 56 30 1454 9A 83 E9 74 72 5C 6F 0D DA FF 5C 72 2C 1C E3 D8 1455 8C 45 D1 45 13 AA 1A 99 7E F6 E6 87 51 9B E5 EF 1457 Authors' Addresses 1459 Stanislav Smyshlyaev (editor) 1460 CryptoPro 1461 18, Suschevsky val 1462 Moscow 127018 1463 Russian Federation 1465 Phone: +7 (495) 995-48-20 1466 Email: svs@cryptopro.ru 1468 Russ Housley 1469 Vigil Security, LLC 1470 918 Spring Knoll Drive 1471 Herndon VA 20170 1472 USA 1474 Email: housley@vigilsec.com 1476 Mihir Bellare 1477 University of California, San Diego 1478 9500 Gilman Drive 1479 La Jolla California 92093-0404 1480 USA 1482 Phone: (858) 534-4544 1483 Email: mihir@eng.ucsd.edu 1485 Evgeny Alekseev 1486 CryptoPro 1487 18, Suschevsky val 1488 Moscow 127018 1489 Russian Federation 1491 Phone: +7 (495) 995-48-20 1492 Email: alekseev@cryptopro.ru 1493 Ekaterina Smyshlyaeva 1494 CryptoPro 1495 18, Suschevsky val 1496 Moscow 127018 1497 Russian Federation 1499 Phone: +7 (495) 995-48-20 1500 Email: ess@cryptopro.ru 1502 Daniel Fox Franke 1503 Akamai Technologies 1504 150 Broadway 1505 Cambridge MA 02142-1413 1506 USA 1508 Email: dfoxfranke@gmail.com 1510 Lilia Ahmetzyanova 1511 CryptoPro 1512 18, Suschevsky val 1513 Moscow 127018 1514 Russian Federation 1516 Phone: +7 (495) 995-48-20 1517 Email: lah@cryptopro.ru 1519 Ruth Ng 1520 University of California, San Diego 1521 9500 Gilman Drive 1522 La Jolla California 92093-0404 1523 USA 1525 Email: ring@eng.ucsd.edu