idnits 2.17.1 draft-smyslov-ike2-gost-06.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 : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (August 25, 2021) is 975 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- == Missing Reference: 'RFCXXXX' is mentioned on line 264, but not defined == Outdated reference: A later version (-11) exists of draft-deremin-rfc4491-bis-06 == Outdated reference: A later version (-14) exists of draft-smyslov-esp-gost-05 Summary: 0 errors (**), 0 flaws (~~), 4 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group V. Smyslov 3 Internet-Draft ELVIS-PLUS 4 Intended status: Informational August 25, 2021 5 Expires: February 26, 2022 7 Using GOST algorithms in IKEv2 8 draft-smyslov-ike2-gost-06 10 Abstract 12 This document defines a set of cryptographic transforms for use in 13 the Internet Key Exchange version 2 (IKEv2) protocol. The transforms 14 are based on Russian cryptographic standard algorithms (GOST). 16 Status of This Memo 18 This Internet-Draft is submitted in full conformance with the 19 provisions of BCP 78 and BCP 79. 21 Internet-Drafts are working documents of the Internet Engineering 22 Task Force (IETF). Note that other groups may also distribute 23 working documents as Internet-Drafts. The list of current Internet- 24 Drafts is at https://datatracker.ietf.org/drafts/current/. 26 Internet-Drafts are draft documents valid for a maximum of six months 27 and may be updated, replaced, or obsoleted by other documents at any 28 time. It is inappropriate to use Internet-Drafts as reference 29 material or to cite them other than as "work in progress." 31 This Internet-Draft will expire on February 26, 2022. 33 Copyright Notice 35 Copyright (c) 2021 IETF Trust and the persons identified as the 36 document authors. All rights reserved. 38 This document is subject to BCP 78 and the IETF Trust's Legal 39 Provisions Relating to IETF Documents 40 (https://trustee.ietf.org/license-info) in effect on the date of 41 publication of this document. Please review these documents 42 carefully, as they describe your rights and restrictions with respect 43 to this document. Code Components extracted from this document must 44 include Simplified BSD License text as described in Section 4.e of 45 the Trust Legal Provisions and are provided without warranty as 46 described in the Simplified BSD License. 48 Table of Contents 50 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 51 2. Terminology and Notation . . . . . . . . . . . . . . . . . . 2 52 3. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 2 53 4. IKE SA Protection . . . . . . . . . . . . . . . . . . . . . . 3 54 5. Pseudo Random Function . . . . . . . . . . . . . . . . . . . 3 55 6. Shared Key Calculation . . . . . . . . . . . . . . . . . . . 3 56 6.1. Recipient Tests . . . . . . . . . . . . . . . . . . . . . 4 57 7. Authentication . . . . . . . . . . . . . . . . . . . . . . . 4 58 7.1. Hash Functions . . . . . . . . . . . . . . . . . . . . . 4 59 7.2. ASN.1 Objects . . . . . . . . . . . . . . . . . . . . . . 5 60 7.2.1. id-tc26-signwithdigest-gost3410-12-256 . . . . . . . 5 61 7.2.2. id-tc26-signwithdigest-gost3410-12-512 . . . . . . . 5 62 8. Security Considerations . . . . . . . . . . . . . . . . . . . 5 63 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 6 64 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 6 65 10.1. Normative References . . . . . . . . . . . . . . . . . . 6 66 10.2. Informative References . . . . . . . . . . . . . . . . . 7 67 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 8 69 1. Introduction 71 This document defines a number of transforms for the Internet Key 72 Exchange version 2 (IKEv2) [RFC7296]. These transforms are based on 73 Russian cryptographic standard algorithms (often called "GOST" 74 algorithms) for hash function, digital signature and key exchange 75 method. Along with transforms defined in [I-D.smyslov-esp-gost], the 76 transforms defined in this specification allow using GOST 77 cryptographic algorithms in IPsec protocols. 79 2. Terminology and Notation 81 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 82 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 83 "OPTIONAL" in this document are to be interpreted as described in BCP 84 14 [RFC2119] [RFC8174] when, and only when, they appear in all 85 capitals, as shown here. 87 3. Overview 89 Russian cryptographic standard (GOST) algorithms are a set of 90 cryptographic algorithms of different types - ciphers, hash 91 functions, digital signatures etc. In particular, Russian 92 cryptographic standard [GOST3412-2015] defines block ciphers 93 "Kuznyechik" (also defined in [RFC7801]) and "Magma" (also defined in 94 [RFC8891]). Cryptographic standard [GOST3410-2012] defines elliptic 95 curve digital signature algorithm (also defined in [RFC7091]), while 97 [GOST3411-2012] defines two cryptographic hash functions "Stribog", 98 with different output length (also defined in [RFC6986]). The 99 parameters for the elliptic curves used in GOST signature and key 100 exchange algorithms are defined in [RFC7836]. 102 4. IKE SA Protection 104 Specification [I-D.smyslov-esp-gost] defines two transforms of type 1 105 (Encryption Algorithm Transform IDs) based on GOST block ciphers that 106 may be used for IKE SA protection: ENCR_KUZNYECHIK_MGM_KTREE (32) 107 based on "Kuznyechik" block cipher and ENCR_MAGMA_MGM_KTREE (33) 108 based on "Magma" block cipher. Since they are AEAD transforms and 109 provide both encryption and authentication, there is no need for new 110 transform type 3 (Integrity Algorithm Transform IDs), because it must 111 not be used with these transforms (or must have a value NONE). 113 5. Pseudo Random Function 115 This specification defines a new transform of type 2 (Pseudorandom 116 Function Transform IDs) - PRF_HMAC_STRIBOG_512 (9). This transform 117 uses PRF HMAC_GOSTR3411_2012_512 defined in Section 4.1.2 of 118 [RFC7836]. The PRF uses GOST R 34.11-2012 ("Stribog") hash-function 119 with 512-bit output defined in [RFC6986][GOST3411-2012] with HMAC 120 [RFC2104] construction. The PRF has a 512-bit block size and a 121 512-bit output length. 123 6. Shared Key Calculation 125 This specification defines two new transforms of type 4 (Diffie- 126 Hellman Group Transform IDs): GOST3410_2012_256 (33) and 127 GOST3410_2012_512 (34). These transforms uses Elliptic Curve Diffie- 128 Hellman (ECDH) key exchange algorithm over Twisted Edwards curves. 129 The parameters for these curves are defined in Section A.2 of 130 [RFC7836]. In particular, transform GOST3410_2012_256 uses id-tc26- 131 gost-3410-2012-256-paramSetA parameter set and GOST3410_2012_512 uses 132 id-tc26-gost-3410-2012-512-paramSetC parameter set (both defined in 133 [RFC7836]). 135 Shared secret is computed as follows. The initiator randomly selects 136 its private key d_i from {1,..,q - 1}, where q is the group order and 137 is a parameter of the selected curve. Then a public key Q_i is 138 computed as a point on the curve: Q_i = d_i * G, where G is the 139 generator for the selected curve, and then is sent to the responder. 140 The responder makes the same calculations to get d_r and Q_r and 141 sends Q_r to the initiator. After peers exchange Q_i and Q_R both 142 sides can compute a point on the curve S = ((m / q) * d_i) * Q_r = 143 ((m / q) * d_r) * Q_i, where m is the subgroup order and is a 144 parameter of the selected curve. The shared secret K is an x 145 coordinate of S in a little-endian representation. The size of K is 146 determined by the size of used curve and is either 256 or 512 bit. 148 When GOST public key is transmitted in the KE payload, it MUST be 149 represented as x coordinate immediately followed by y coordinate, 150 each in a little-endian representation. The size of each coordinate 151 is determined by the size of the used curve and is either 256 or 512 152 bits, so that the size of the Key Exchange Data field in the KE 153 payload is either 64 or 128 octets. 155 6.1. Recipient Tests 157 Upon receiving peer's public key implementations MUST check that the 158 key is actually a point on the curve, otherwise the exchange fails. 159 Implementations MUST check that the calculated public value S is not 160 an identity element of the curve, in which case the exchange fails. 162 7. Authentication 164 GOST digital signatures algorithm GOST R 34.10-2012 is defined in 165 [RFC7091][GOST3410-2012]. There are two variants of GOST signature 166 algorithm - one over 256-bit elliptic curve and the other over 167 512-bit key elliptic curve. 169 When GOST digital signature is used in IKEv2 for authentication 170 purposes, an Authentication Method "Digital Signature" (14) MUST be 171 specified in the AUTH payload. The AlgorithmIdentifier ASN.1 objects 172 for GOST digital signature algorithm are defined in Section 7.2. 174 The signature value, as defined in [RFC7091][GOST3410-2012], consists 175 of two integers r and s. The size of each integer is either 256 bit 176 or 512 bit depending on the used elliptic curve. The content of the 177 Signature Value field in the AUTH payload MUST consist of s 178 immediately followed by r, each in a big-endian representation, so 179 that the size of the field is either 64 or 128 octets. 181 7.1. Hash Functions 183 GOST digital signatures algorithm uses GOST hash functions GOST R 184 34.11-2012 ("Stribog") defined in [RFC6986][GOST3411-2012]. There 185 are two "Stribog" hash functions - one with 256-bit output length and 186 the other with 512-bit output length. 188 This specification defines two new values for IKEv2 Hash Algorithms 189 registry: STRIBOG_256 (6) for GOST hash function with 256-bit output 190 length and STRIBOG_512 (7) for the 512-bit length output. These 191 values MUST be included in the SIGNATURE_HASH_ALGORITHMS notify if a 192 corresponding GOST digital signature algorithm is supported by the 193 sender. 195 7.2. ASN.1 Objects 197 This section lists GOST signature algorithm ASN.1 AlgorithmIdentifier 198 objects in binary form. This objects are defined in 199 [I-D.deremin-rfc4491-bis][USING-GOST-IN-CERTS] and are provided here 200 for convenience. 202 7.2.1. id-tc26-signwithdigest-gost3410-12-256 204 id-tc26-signwithdigest-gost3410-12-256 OBJECT IDENTIFIER ::= { iso(1) 205 member-body(2) ru(643) rosstandart(7) tc26(1) algorithms(1) 206 signwithdigest(3) gost3410-12-256(2) } 208 Parameters are absent. 210 Name = id-tc26-signwithdigest-gost3410-12-256 211 OID = 1.2.643.7.1.1.3.2 212 Length = 12 213 0000: 300a 0608 2a85 0307 0101 0302 215 7.2.2. id-tc26-signwithdigest-gost3410-12-512 217 id-tc26-signwithdigest-gost3410-12-512 OBJECT IDENTIFIER ::= { iso(1) 218 member-body(2) ru(643) rosstandart(7) tc26(1) algorithms(1) 219 signwithdigest(3) gost3410-12-512(3) } 221 Parameters are absent. 223 Name = id-tc26-signwithdigest-gost3410-12-512 224 OID = 1.2.643.7.1.1.3.3 225 Length = 12 226 0000: 300a 0608 2a85 0307 0101 0303 228 8. Security Considerations 230 The security considerations of [RFC7296] apply accordingly. 232 The security of GOST elliptic curves is discussed in 233 [GOST-EC-SECURITY]. The security of "Stribog" hash function is 234 discussed in [STRIBOG-SECURITY]. A second preimage attack on 235 "Stribog" is described in [STRIBOG-PREIMAGE] if message size exceeds 236 2^259 blocks. This attack is not relevant to how "Stribog" is used 237 in IKEv2. 239 9. IANA Considerations 241 IANA has assigned one Transform ID in the "Transform Type 2 - 242 Pseudorandom Function Transform IDs" registry (where RFCXXXX is this 243 document): 245 Number Name Reference 246 ------------------------------------------------- 247 9 PRF_HMAC_STRIBOG_512 [RFCXXXX] 249 IANA has assigned two Transform IDs in the "Transform Type 4 - 250 Diffie-Hellman Group Transform IDs" registry (where RFCXXXX is this 251 document): 253 Number Name Recipient Tests Reference 254 --------------------------------------------------------------------- 255 33 GOST3410_2012_256 [RFCXXXX] Sec. 6.1 [RFCXXXX] 256 34 GOST3410_2012_512 [RFCXXXX] Sec. 6.1 [RFCXXXX] 258 IANA has assigned two values in the "IKEv2 Hash Algorithms" registry 259 (where RFCXXXX is this document): 261 Number Hash Algorithm Reference 262 ------------------------------------------------- 263 6 STRIBOG_256 [RFCXXXX] 264 7 STRIBOG_512 [RFCXXXX] 266 10. References 268 10.1. Normative References 270 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 271 Requirement Levels", BCP 14, RFC 2119, 272 DOI 10.17487/RFC2119, March 1997, 273 . 275 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 276 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 277 May 2017, . 279 [RFC6986] Dolmatov, V., Ed. and A. Degtyarev, "GOST R 34.11-2012: 280 Hash Function", RFC 6986, DOI 10.17487/RFC6986, August 281 2013, . 283 [RFC7091] Dolmatov, V., Ed. and A. Degtyarev, "GOST R 34.10-2012: 284 Digital Signature Algorithm", RFC 7091, 285 DOI 10.17487/RFC7091, December 2013, 286 . 288 [RFC7296] Kaufman, C., Hoffman, P., Nir, Y., Eronen, P., and T. 289 Kivinen, "Internet Key Exchange Protocol Version 2 290 (IKEv2)", STD 79, RFC 7296, DOI 10.17487/RFC7296, October 291 2014, . 293 [RFC7836] Smyshlyaev, S., Ed., Alekseev, E., Oshkin, I., Popov, V., 294 Leontiev, S., Podobaev, V., and D. Belyavsky, "Guidelines 295 on the Cryptographic Algorithms to Accompany the Usage of 296 Standards GOST R 34.10-2012 and GOST R 34.11-2012", 297 RFC 7836, DOI 10.17487/RFC7836, March 2016, 298 . 300 [I-D.deremin-rfc4491-bis] 301 Baryshkov, D., Nikolaev, V., and A. Chelpanov, "Using GOST 302 R 34.10-2012 and GOST R 34.11-2012 algorithms with the 303 Internet X.509 Public Key Infrastructure", draft-deremin- 304 rfc4491-bis-06 (work in progress), May 2020. 306 [I-D.smyslov-esp-gost] 307 Smyslov, V., "Using GOST ciphers in ESP and IKEv2", draft- 308 smyslov-esp-gost-05 (work in progress), April 2021. 310 10.2. Informative References 312 [RFC2104] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed- 313 Hashing for Message Authentication", RFC 2104, 314 DOI 10.17487/RFC2104, February 1997, 315 . 317 [RFC7801] Dolmatov, V., Ed., "GOST R 34.12-2015: Block Cipher 318 "Kuznyechik"", RFC 7801, DOI 10.17487/RFC7801, March 2016, 319 . 321 [RFC8891] Dolmatov, V., Ed. and D. Baryshkov, "GOST R 34.12-2015: 322 Block Cipher "Magma"", RFC 8891, DOI 10.17487/RFC8891, 323 September 2020, . 325 [GOST3410-2012] 326 Federal Agency on Technical Regulating and Metrology, 327 "Information technology. Cryptographic data security. 328 Signature and verification processes of [electronic] 329 digital signature", GOST R 34.10-2012, 2012. 331 (In Russian) 333 [GOST3411-2012] 334 Federal Agency on Technical Regulating and Metrology, 335 "Information technology. Cryptographic data security. 336 Hashing function", GOST R 34.11-2012, 2012. 338 (In Russian) 340 [GOST3412-2015] 341 Federal Agency on Technical Regulating and Metrology, 342 "Information technology. Cryptographic data security. 343 Block ciphers", GOST R 34.12-2015, 2015. 345 (In Russian) 347 [USING-GOST-IN-CERTS] 348 Federal Agency on Technical Regulating and Metrology, 349 "Information technology. Cryptographic data security. 350 Using GOST R 34.10-2012 and GOST R 34.11-2012 algorithms 351 in X.509 Certificates, CRLs and PKCS #10 Certificate 352 Requests", R 1323565.1.023-2018, 2018. 354 (In Russian) 356 [GOST-EC-SECURITY] 357 Alekseev, E., Nikolaev, V., and S. Smyshlyaev, "On the 358 security properties of Russian standardized elliptic 359 curves", https://doi.org/10.4213/mvk260, 2018. 361 [STRIBOG-SECURITY] 362 Wang, Z., Yu, H., and X. Wang, "Cryptanalysis of GOST R 363 hash function", 364 https://doi.org/10.1016/j.ipl.2014.07.007, 2014. 366 [STRIBOG-PREIMAGE] 367 Guo, J., Jean, J., Leurent, G., Peyrin, T., and L. Wang, 368 "The Usage of Counter Revisited: Second-Preimage Attack on 369 New Russian Standardized Hash Function", 370 https://eprint.iacr.org/2014/675, 2014. 372 Author's Address 373 Valery Smyslov 374 ELVIS-PLUS 375 PO Box 81 376 Moscow (Zelenograd) 124460 377 RU 379 Phone: +7 495 276 0211 380 Email: svan@elvis.ru