RFC 9337: Generating Password-Based Keys Using the GOST Algorithms
- E. Karelina, Ed.
Abstract
This document specifies how to use "PKCS #5: Password-Based Cryptography Specification Version 2.1" (RFC 8018) to generate a symmetric key from a password in conjunction with the Russian national standard GOST algorithms.¶
PKCS #5 applies a Pseudorandom Function (PRF) -- a cryptographic hash, cipher, or Hash-Based Message Authentication Code (HMAC) -- to the input password along with a salt value and repeats the process many times to produce a derived key.¶
This specification has been developed outside the IETF. The purpose of publication being to facilitate interoperable implementations that wish to support the GOST algorithms. This document does not imply IETF endorsement of the cryptographic algorithms used here.¶
Status of This Memo
This document is not an Internet Standards Track specification; it is published for informational purposes.¶
This is a contribution to the RFC Series, independently of any other RFC stream. The RFC Editor has chosen to publish this document at its discretion and makes no statement about its value for implementation or deployment. Documents approved for publication by the RFC Editor are not candidates for any level of Internet Standard; see Section 2 of RFC 7841.¶
Information about the current status of this document, any
errata, and how to provide feedback on it may be obtained at
https://
Copyright Notice
Copyright (c) 2022 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents
(https://
1. Introduction
This document provides a specification of usage of GOST R 34.12-2015 encryption algorithms and the GOST R 34.11-2012 hashing functions with PKCS #5. The methods described in this document are designed to generate key information using the user's password and to protect information using the generated keys.¶
2. Conventions Used in This Document
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
3. Basic Terms and Definitions
Throughout this document, the following notation is used:¶
This document uses the following abbreviations and symbols:¶
4. Algorithm for Generating a Key from a Password
The DK is calculated by means of a key derivation function PBKDF2 (P, S, c, dkLen) (see [RFC8018], Section 5.2) using the HMAC_GOSTR3411 function as the PRF:¶
DK = PBKDF2 (P, S, c, dkLen).¶
The PBKDF2 function is defined as the following algorithm:¶
5. Data Encryption
5.1. GOST R 34.12-2015 Data Encryption
Data encryption using the DK is carried out in accordance with the PBES2 scheme (see [RFC8018], Section 6.2) using GOST R 34.12-2015 in CTR_ACPKM mode (see [RFC8645]).¶
5.1.1. Encryption
The encryption process for PBES2 consists of the following steps:¶
5.1.2. Decryption
The decryption process for PBES2 consists of the following steps:¶
6. Message Authentication
The PBMAC1 scheme is used for message authentication (see [RFC8018], Section 7.1). This scheme is based on the HMAC_GOSTR3411 function.¶
6.1. MAC Generation
The MAC generation operation for PBMAC1 consists of the following steps:¶
6.2. MAC Verification
The MAC verification operation for PBMAC1 consists of the following steps:¶
7. Identifiers and Parameters
This section defines the ASN.1 syntax for the key derivation functions, the encryption schemes, the message authentication scheme, and supporting techniques (see [RFC8018]).¶
7.1. PBKDF2
The Object Identifier (OID) id-PBKDF2 identifies the PBKDF2 key derivation function:¶
The parameters field associated with this OID in an Algorithm
The fields of type PBKDF2-params have the following meanings:¶
7.2. PBES2
The OID id-PBES2 identifies the PBES2 encryption scheme:¶
The parameters field associated with this OID in an Algorithm
The fields of type PBES2-params have the following meanings:¶
7.3. Identifier and Parameters of Gost34.12-2015 Encryption Scheme
The Gost34.12-2015 encryption algorithm identifier SHALL take one of the following values:¶
When the id
When the id
When the id
When the id
The parameters field in an Algorithm
The field of type Gost3412
8. Security Considerations
For information on security considerations for password-based cryptography, see [RFC8018].¶
Conforming applications MUST use unique values for ukm and S in order to avoid the encryption of different data on the same keys with the same initialization vector.¶
It is RECOMMENDED that parameter S consist of at least 32 octets of pseudorandom data in order to reduce the probability of collisions of keys generated from the same password.¶
9. IANA Considerations
This document has no IANA actions.¶
10. References
10.1. Normative References
- [GostPkcs5]
-
Potashnikov, A., Karelina, E., Pianov, S., and A. Naumenko, "Information technology. Cryptographic Data Security. Password-based key security.", R 1323565
.1 ..040 -2022 . Federal Agency on Technical Regulating and Metrology (In Russian) - [RFC0020]
-
Cerf, V., "ASCII format for network interchange", STD 80, RFC 20, DOI 10
.17487 , , <https:///RFC0020 www >..rfc -editor .org /info /rfc20 - [RFC2104]
-
Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed-Hashing for Message Authentication", RFC 2104, DOI 10
.17487 , , <https:///RFC2104 www >..rfc -editor .org /info /rfc2104 - [RFC2119]
-
Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10
.17487 , , <https:///RFC2119 www >..rfc -editor .org /info /rfc2119 - [RFC6986]
-
Dolmatov, V., Ed. and A. Degtyarev, "GOST R 34.11-2012: Hash Function", RFC 6986, DOI 10
.17487 , , <https:///RFC6986 www >..rfc -editor .org /info /rfc6986 - [RFC7801]
-
Dolmatov, V., Ed., "GOST R 34.12-2015: Block Cipher "Kuznyechik"", RFC 7801, DOI 10
.17487 , , <https:///RFC7801 www >..rfc -editor .org /info /rfc7801 - [RFC7836]
-
Smyshlyaev, S., Ed., Alekseev, E., Oshkin, I., Popov, V., Leontiev, S., Podobaev, V., and D. Belyavsky, "Guidelines on the Cryptographic Algorithms to Accompany the Usage of Standards GOST R 34.10-2012 and GOST R 34.11-2012", RFC 7836, DOI 10
.17487 , , <https:///RFC7836 www >..rfc -editor .org /info /rfc7836 - [RFC8018]
-
Moriarty, K., Ed., Kaliski, B., and A. Rusch, "PKCS #5: Password-Based Cryptography Specification Version 2.1", RFC 8018, DOI 10
.17487 , , <https:///RFC8018 www >..rfc -editor .org /info /rfc8018 - [RFC8174]
-
Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10
.17487 , , <https:///RFC8174 www >..rfc -editor .org /info /rfc8174 - [RFC8645]
-
Smyshlyaev, S., Ed., "Re-keying Mechanisms for Symmetric Keys", RFC 8645, DOI 10
.17487 , , <https:///RFC8645 www >..rfc -editor .org /info /rfc8645 - [RFC8891]
-
Dolmatov, V., Ed. and D. Baryshkov, "GOST R 34.12-2015: Block Cipher "Magma"", RFC 8891, DOI 10
.17487 , , <https:///RFC8891 www >..rfc -editor .org /info /rfc8891
10.2. Informative References
- [RFC6070]
-
Josefsson, S., "PKCS #5: Password-Based Key Derivation Function 2 (PBKDF2) Test Vectors", RFC 6070, DOI 10
.17487 , , <https:///RFC6070 www >..rfc -editor .org /info /rfc6070
Appendix A. PBKDF2 HMAC_GOSTR3411 Test Vectors
These test vectors are formed by analogy with test vectors from [RFC6070]. The input strings below are encoded using ASCII (see [RFC0020]). The sequence "\0" (without quotation marks) means a literal ASCII NULL value (1 octet). "DK" refers to the derived key.¶
Acknowledgments
The author thanks Potashnikov Alexander, Pianov Semen, Davletshina Alexandra, Belyavsky Dmitry, and Smyslov Valery for their careful readings and useful comments.¶