idnits 2.17.1 draft-smyslov-ike2-gost-04.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 27, 2020) is 1330 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- == Missing Reference: 'RFCXXXX' is mentioned on line 262, but not defined == Outdated reference: A later version (-14) exists of draft-smyslov-esp-gost-03 Summary: 0 errors (**), 0 flaws (~~), 3 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 27, 2020 5 Expires: February 28, 2021 7 Using GOST algorithms in IKEv2 8 draft-smyslov-ike2-gost-04 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 28, 2021. 33 Copyright Notice 35 Copyright (c) 2020 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 [I-D.dolmatov-magma]). Cryptographic standard [GOST3410-2012] 95 defines elliptic curve digital signature algorithm (also defined in 97 [RFC7091]), while [GOST3411-2012] defines two cryptographic hash 98 functions "Stribog", with different output length (also defined in 99 [RFC6986]). The parameters for the elliptic curves used in GOST 100 signature and key 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 (). This 117 transform uses PRF HMAC_GOSTR3411_2012_512 defined in Section 4.1.2 118 of [RFC7836]. The PRF uses GOST R 34.11-2012 ("Stribog") hash- 119 function with 512-bit output defined in [RFC6986][GOST3411-2012] with 120 HMAC [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 () and 127 GOST3410_2012_512 (). These transforms uses Elliptic 128 Curve Diffie-Hellman (ECDH) key exchange algorithm over Twisted 129 Edwards curves. The parameters for these curves are defined in 130 Section A.2 of [RFC7836]. In particular, transform GOST3410_2012_256 131 uses id-tc26-gost-3410-2012-256-paramSetA parameter set and 132 GOST3410_2012_512 uses id-tc26-gost-3410-2012-512-paramSetC parameter 133 set (both defined in [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 () for GOST hash function with 190 256-bit output length and STRIBOG_512 () for the 512-bit 191 length output. These values MUST be included in the 192 SIGNATURE_HASH_ALGORITHMS notify if a corresponding GOST digital 193 signature algorithm is supported by the sender. 195 7.2. ASN.1 Objects 197 This section lists GOST signature algorithm ASN.1 objects in binary 198 form. 200 7.2.1. id-tc26-signwithdigest-gost3410-12-256 202 id-tc26-signwithdigest-gost3410-12-256 OBJECT IDENTIFIER ::= { iso(1) 203 member-body(2) ru(643) rosstandart(7) tc26(1) algorithms(1) 204 signwithdigest(3) gost3410-12-256(2) } 206 Parameters are absent. 208 Name = id-tc26-signwithdigest-gost3410-12-256 209 OID = 1.2.643.7.1.1.3.2 210 Length = 12 211 0000: 300a 0608 2a85 0307 0101 0302 213 7.2.2. id-tc26-signwithdigest-gost3410-12-512 215 id-tc26-signwithdigest-gost3410-12-512 OBJECT IDENTIFIER ::= { iso(1) 216 member-body(2) ru(643) rosstandart(7) tc26(1) algorithms(1) 217 signwithdigest(3) gost3410-12-512(3) } 219 Parameters are absent. 221 Name = id-tc26-signwithdigest-gost3410-12-256 222 OID = 1.2.643.7.1.1.3.3 223 Length = 12 224 0000: 300a 0608 2a85 0307 0101 0303 226 8. Security Considerations 228 The security considerations of [RFC7296] apply accordingly. 230 The security of GOST elliptic curves is discussed in 231 [GOST-EC-SECURITY]. The security of "Stribog" hash function is 232 discussed in [STRIBOG-SECURITY]. A second preimage attack on 233 "Stribog" is described in [STRIBOG-PREIMAGE] if message size exceeds 234 2^259 blocks. This attack is not relevant to how "Stribog" is used 235 in IKEv2. 237 9. IANA Considerations 239 IANA has assigned one Transform ID in the "Transform Type 2 - 240 Pseudorandom Function Transform IDs" registry (where RFCXXXX is this 241 document): 243 Number Name Reference 244 ------------------------------------------------- 245 9 PRF_HMAC_STRIBOG_512 [RFCXXXX] 247 IANA has assigned two Transform IDs in the "Transform Type 4 - 248 Diffie-Hellman Group Transform IDs" registry (where RFCXXXX is this 249 document): 251 Number Name Recipient Tests Reference 252 --------------------------------------------------------------------- 253 33 GOST3410_2012_256 [RFCXXXX] Sec. 6.1 [RFCXXXX] 254 34 GOST3410_2012_512 [RFCXXXX] Sec. 6.1 [RFCXXXX] 256 IANA has assigned two values in the "IKEv2 Hash Algorithms" registry 257 (where RFCXXXX is this document): 259 Number Hash Algorithm Reference 260 ------------------------------------------------- 261 6 STRIBOG_256 [RFCXXXX] 262 7 STRIBOG_512 [RFCXXXX] 264 10. References 266 10.1. Normative References 268 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 269 Requirement Levels", BCP 14, RFC 2119, 270 DOI 10.17487/RFC2119, March 1997, 271 . 273 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 274 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 275 May 2017, . 277 [RFC6986] Dolmatov, V., Ed. and A. Degtyarev, "GOST R 34.11-2012: 278 Hash Function", RFC 6986, DOI 10.17487/RFC6986, August 279 2013, . 281 [RFC7091] Dolmatov, V., Ed. and A. Degtyarev, "GOST R 34.10-2012: 282 Digital Signature Algorithm", RFC 7091, 283 DOI 10.17487/RFC7091, December 2013, 284 . 286 [RFC7296] Kaufman, C., Hoffman, P., Nir, Y., Eronen, P., and T. 287 Kivinen, "Internet Key Exchange Protocol Version 2 288 (IKEv2)", STD 79, RFC 7296, DOI 10.17487/RFC7296, October 289 2014, . 291 [RFC7836] Smyshlyaev, S., Ed., Alekseev, E., Oshkin, I., Popov, V., 292 Leontiev, S., Podobaev, V., and D. Belyavsky, "Guidelines 293 on the Cryptographic Algorithms to Accompany the Usage of 294 Standards GOST R 34.10-2012 and GOST R 34.11-2012", 295 RFC 7836, DOI 10.17487/RFC7836, March 2016, 296 . 298 [I-D.smyslov-esp-gost] 299 Smyslov, V., "Using GOST ciphers in ESP and IKEv2", draft- 300 smyslov-esp-gost-03 (work in progress), May 2020. 302 10.2. Informative References 304 [RFC2104] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed- 305 Hashing for Message Authentication", RFC 2104, 306 DOI 10.17487/RFC2104, February 1997, 307 . 309 [RFC7801] Dolmatov, V., Ed., "GOST R 34.12-2015: Block Cipher 310 "Kuznyechik"", RFC 7801, DOI 10.17487/RFC7801, March 2016, 311 . 313 [I-D.dolmatov-magma] 314 Dolmatov, V. and D. Eremin-Solenikov, "GOST R 34.12-2015: 315 Block Cipher "Magma"", draft-dolmatov-magma-06 (work in 316 progress), March 2020. 318 [GOST3410-2012] 319 Federal Agency on Technical Regulating and Metrology, 320 "Information technology. Cryptographic data security. 321 Signature and verification processes of [electronic] 322 digital signature", GOST R 34.10-2012, 2012. 324 (In Russian) 326 [GOST3411-2012] 327 Federal Agency on Technical Regulating and Metrology, 328 "Information technology. Cryptographic data security. 329 Hashing function", GOST R 34.11-2012, 2012. 331 (In Russian) 333 [GOST3412-2015] 334 Federal Agency on Technical Regulating and Metrology, 335 "Information technology. Cryptographic data security. 336 Block ciphers", GOST R 34.12-2015, 2015. 338 (In Russian) 340 [GOST-EC-SECURITY] 341 Alekseev, E., Nikolaev, V., and S. Smyshlyaev, "On the 342 security properties of Russian standardized elliptic 343 curves", https://doi.org/10.4213/mvk260, 2018. 345 [STRIBOG-SECURITY] 346 Wang, Z., Yu, H., and X. Wang, "Cryptanalysis of GOST R 347 hash function", 348 https://doi.org/10.1016/j.ipl.2014.07.007, 2014. 350 [STRIBOG-PREIMAGE] 351 Guo, J., Jean, J., Leurent, G., Peyrin, T., and L. Wang, 352 "The Usage of Counter Revisited: Second-Preimage Attack on 353 New Russian Standardized Hash Function", 354 https://eprint.iacr.org/2014/675, 2014. 356 Author's Address 358 Valery Smyslov 359 ELVIS-PLUS 360 PO Box 81 361 Moscow (Zelenograd) 124460 362 RU 364 Phone: +7 495 276 0211 365 Email: svan@elvis.ru