Tech-invite3GPPspaceIETFspace
959493929190898887868584838281807978777675747372717069686766656463626160595857565554535251504948474645444342414039383736353433323130292827262524232221201918171615141312111009080706050403020100
in Index   Prev   Next

RFC 8018

PKCS #5: Password-Based Cryptography Specification Version 2.1

Pages: 40
Informational
Errata
Obsoletes:  2898
Part 2 of 2 – Pages 19 to 40
First   Prev   None

Top   ToC   RFC8018 - Page 19   prevText

9. Normative References

[ANSIX952] ANSI, "Triple Data Encryption Algorithm Modes of Operation", Accredited Standards Committee X9, X9.52-1998, July 1998. [BELLOV] Bellovin, S. and M. Merritt, "Encrypted Key Exchange: Password-based Protocols Secure against Dictionary Attacks", Proceedings of the IEEE Symposium on Research in Security and Privacy, pages 72-84, IEEE Computer Society, DOI 10.1109/RISP.1992.213269, 1992. [COCHRAN] Cochran, M., "Notes on the Wang et al. 2^63 SHA-1 Differential Path", Cryptology ePrint Archive: Report 2007/474, August 2008, <http://eprint.iacr.org/2007/474>. [ISO8824-1] International Organization for Standardization, "Information technology - Abstract Syntax Notation One (ASN.1) - Specification of basic notation", ISO/IEC 8824-1:2008, 2008. [ISO8824-2] International Organization for Standardization, "Information technology - Abstract Syntax Notation One (ASN.1) - Information object specification", ISO/IEC 8824-2:2008, 2008.
Top   ToC   RFC8018 - Page 20
   [ISO8824-3]
              International Organization for Standardization,
              "Information technology - Abstract Syntax Notation One
              (ASN.1) - Constraint specification", ISO/IEC 8824-3:2008,
              2008.

   [ISO8824-4]
              International Organization for Standardization,
              "Information technology - Abstract Syntax Notation One
              (ASN.1) - Parameterization of ASN.1 specifications",
              ISO/IEC 8824-4:2008, 2008.

   [JABLON]   Jablon, D., "Strong Password-Only Authenticated Key
              Exchange", ACM SIGCOMM Computer Communication Review,
              Volume 26, Issue 5, DOI 10.1145/242896.242897, October
              1996.

   [MORRIS]   Morris, R. and K. Thompson, "Password security: A case
              history", Communications of the ACM, Vol. 22, Issue 11,
              pages 594-597, DOI 10.1145/359168.359172, November 1979.

   [NIST46]   National Institute of Standards and Technology (NIST),
              "Data Encryption Standard", FIPS PUB 46-3, October 1999.

   [NIST81]   National Institute of Standards and Technology (NIST),
              "DES Modes of Operation", FIPS PUB 81, December 2, 1980.

   [NIST180]  National Institute of Standards and Technology, "Secure
              Hash Standard (SHS)", FIPS PUB 180-4,
              DOI 10.6028/NIST.FIPS.180-4, August 2015.

   [NIST197]  National Institute of Standards and Technology (NIST),
              "Advance Encryption Standard (AES)", FIPS PUB 197,
              November 2001.

   [NIST198]  National Institute of Standards and Technology (NIST),
              "The Keyed - Hash Message Authentication Code (HMAC)",
              FIPS PUB 198-1, July 2008.

   [NISTSP63] National Institute of Standards and Technology (NIST),
              "Electronic Authentication Guideline", NIST Special
              Publication 800-63-2, DOI 10.6028/NIST.SP.800-63-2, August
              2013.
Top   ToC   RFC8018 - Page 21
   [NISTSP132]
              National Institute of Standards and Technology (NIST),
              "Recommendation for Password-Based Key Derivation, Part 1:
              Storage Applications", NIST Special Publication 800-132,
              DOI 10.6028/NIST.SP.800-132, December 2010.

   [PKCS5_15] RSA Laboratories, "PKCS #5: Password-Based Encryption
              Standard Version 1.5", November 1993.

   [PKCS5_21] RSA Laboratories, "PKCS #5: Password-Based Encryption
              Standard Version 2.1", October 2012.

   [PKCS8]    Kaliski, B., "Public-Key Cryptography Standards (PKCS) #8:
              Private-Key Information Syntax Specification Version 1.2",
              RFC 5208, DOI 10.17487/RFC5208, May 2008,
              <http://www.rfc-editor.org/info/rfc5208>.

   [RC5]      Rivest, R.L., "The RC5 encryption algorithm", In
              Proceedings of the Second International Workshop on Fast
              Software Encryption, pages 86-96, Springer-Verlag,
              DOI 10.1007/3-540-60590-8_7, 1994.

   [RFC1319]  Kaliski, B., "The MD2 Message-Digest Algorithm", RFC 1319,
              DOI 10.17487/RFC1319, April 1992,
              <http://www.rfc-editor.org/info/rfc1319>.

   [RFC1321]  Rivest, R., "The MD5 Message-Digest Algorithm", RFC 1321,
              DOI 10.17487/RFC1321, April 1992,
              <http://www.rfc-editor.org/info/rfc1321>.

   [RFC1423]  Balenson, D., "Privacy Enhancement for Internet Electronic
              Mail: Part III: Algorithms, Modes, and Identifiers",
              RFC 1423, DOI 10.17487/RFC1423, February 1993,
              <http://www.rfc-editor.org/info/rfc1423>.

   [RFC2040]  Baldwin, R. and R. Rivest, "The RC5, RC5-CBC, RC5-CBC-Pad,
              and RC5-CTS Algorithms", RFC 2040, DOI 10.17487/RFC2040,
              October 1996, <http://www.rfc-editor.org/info/rfc2040>.

   [RFC2104]  Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed-
              Hashing for Message Authentication", RFC 2104,
              DOI 10.17487/RFC2104, February 1997,
              <http://www.rfc-editor.org/info/rfc2104>.

   [RFC2268]  Rivest, R., "A Description of the RC2(r) Encryption
              Algorithm", RFC 2268, DOI 10.17487/RFC2268, March 1998,
              <http://www.rfc-editor.org/info/rfc2268>.
Top   ToC   RFC8018 - Page 22
   [RFC2898]  Kaliski, B., "PKCS #5: Password-Based Cryptography
              Specification Version 2.0", RFC 2898,
              DOI 10.17487/RFC2898, September 2000,
              <http://www.rfc-editor.org/info/rfc2898>.

   [RFC3629]  Yergeau, F., "UTF-8, a transformation format of ISO
              10646", STD 63, RFC 3629, DOI 10.17487/RFC3629, November
              2003, <http://www.rfc-editor.org/info/rfc3629>.

   [RFC5652]  Housley, R., "Cryptographic Message Syntax (CMS)", STD 70,
              RFC 5652, DOI 10.17487/RFC5652, September 2009,
              <http://www.rfc-editor.org/info/rfc5652>.

   [RFC5958]  Turner, S., "Asymmetric Key Packages", RFC 5958,
              DOI 10.17487/RFC5958, August 2010,
              <http://www.rfc-editor.org/info/rfc5958>.

   [RFC6149]  Turner, S. and L. Chen, "MD2 to Historic Status",
              RFC 6149, DOI 10.17487/RFC6149, March 2011,
              <http://www.rfc-editor.org/info/rfc6149>.

   [RFC6151]  Turner, S. and L. Chen, "Updated Security Considerations
              for the MD5 Message-Digest and the HMAC-MD5 Algorithms",
              RFC 6151, DOI 10.17487/RFC6151, March 2011,
              <http://www.rfc-editor.org/info/rfc6151>.

   [RFC6194]  Polk, T., Chen, L., Turner, S., and P. Hoffman, "Security
              Considerations for the SHA-0 and SHA-1 Message-Digest
              Algorithms", RFC 6194, DOI 10.17487/RFC6194, March 2011,
              <http://www.rfc-editor.org/info/rfc6194>.

   [WANG]     Wang, X., Yao, A.C., and F. Yao, "Cryptanalysis on SHA-1",
              presented by Adi Shamir at the rump session of CRYPTO
              2005, <http://csrc.nist.gov/groups/ST/hash/documents/
              Wang_SHA1-New-Result.pdf>.

   [WU]       Wu, T., "The Secure Remote Password protocol", In
              Proceedings of the 1998 Internet Society Network and
              Distributed System Security Symposium, pages 97-111,
              Internet Society, 1998,
              <https://www.isoc.org/isoc/conferences/ndss/98/wu.pdf>.
Top   ToC   RFC8018 - Page 23

Appendix A. ASN.1 Syntax

This section defines ASN.1 syntax for the key derivation functions, the encryption schemes, the message authentication scheme, and supporting techniques. The intended application of these definitions includes PKCS #8 and other syntax for key management, encrypted data, and integrity-protected data. (Various aspects of ASN.1 are specified in several ISO/IEC standards [ISO8824-1] [ISO8824-2] [ISO8824-3] [ISO8824-4].) The object identifier pkcs-5 identifies the arc of the OID tree from which the OIDs (specific to PKCS #5) in this section are derived: rsadsi OBJECT IDENTIFIER ::= {iso(1) member-body(2) us(840) 113549} pkcs OBJECT IDENTIFIER ::= {rsadsi 1} pkcs-5 OBJECT IDENTIFIER ::= {pkcs 5}

A.1. PBKDF1

No object identifier is given for PBKDF1, as the object identifiers for PBES1 are sufficient for existing applications, and PBKDF2 is recommended for new applications.

A.2. PBKDF2

The object identifier id-PBKDF2 identifies the PBKDF2 key derivation function (Section 5.2). id-PBKDF2 OBJECT IDENTIFIER ::= {pkcs-5 12} The parameters field associated with this OID in an AlgorithmIdentifier shall have type PBKDF2-params: PBKDF2-params ::= SEQUENCE { salt CHOICE { specified OCTET STRING, otherSource AlgorithmIdentifier {{PBKDF2-SaltSources}} }, iterationCount INTEGER (1..MAX), keyLength INTEGER (1..MAX) OPTIONAL, prf AlgorithmIdentifier {{PBKDF2-PRFs}} DEFAULT algid-hmacWithSHA1 }
Top   ToC   RFC8018 - Page 24
   The fields of type PBKDF2-params have the following meanings:

      -  salt specifies the salt value or the source of the salt value.
         It shall either be an octet string or an algorithm ID with an
         OID in the set PBKDF2-SaltSources, which is reserved for future
         versions of PKCS #5.

         The salt-source approach is intended to indicate how the salt
         value is to be generated as a function of parameters in the
         algorithm ID, application data, or both.  For instance, it may
         indicate that the salt value is produced from the encoding of a
         structure that specifies detailed information about the derived
         key as suggested in Section 4.1.  Some of the information may
         be carried elsewhere, e.g., in the encryption algorithm ID.
         However, such facilities are deferred to a future version of
         PKCS #5.

         In this version, an application may achieve the benefits
         mentioned in Section 4.1 by choosing a particular
         interpretation of the salt value in the specified alternative.

      PBKDF2-SaltSources ALGORITHM-IDENTIFIER ::= { ... }

      -  iterationCount specifies the iteration count.  The maximum
         iteration count allowed depends on the implementation.  It is
         expected that implementation profiles may further constrain the
         bounds.

      -  keyLength, an optional field, is the length in octets of the
         derived key.  The maximum key length allowed depends on the
         implementation; it is expected that implementation profiles may
         further constrain the bounds.  The field is provided for
         convenience only; the key length is not cryptographically
         protected.  If there is concern about interaction between
         operations with different key lengths for a given salt (see
         Section 4.1), the salt should distinguish among the different
         key lengths.

      -  prf identifies the underlying pseudorandom function.  It shall
         be an algorithm ID with an OID in the set PBKDF2-PRFs, which
         for this version of PKCS #5 shall consist of id-hmacWithSHA1
         (see Appendix B.1.1) and any other OIDs defined by the
         application.
Top   ToC   RFC8018 - Page 25
      PBKDF2-PRFs ALGORITHM-IDENTIFIER ::= {
        {NULL IDENTIFIED BY id-hmacWithSHA1},
        {NULL IDENTIFIED BY id-hmacWithSHA224},
        {NULL IDENTIFIED BY id-hmacWithSHA256},
        {NULL IDENTIFIED BY id-hmacWithSHA384},
        {NULL IDENTIFIED BY id-hmacWithSHA512},
        {NULL IDENTIFIED BY id-hmacWithSHA512-224},
        {NULL IDENTIFIED BY id-hmacWithSHA512-256},
        ...
      }

   The default pseudorandom function is HMAC-SHA-1:

         algid-hmacWithSHA1 AlgorithmIdentifier {{PBKDF2-PRFs}} ::=
             {algorithm id-hmacWithSHA1, parameters NULL : NULL}

A.3. PBES1

Different object identifiers identify the PBES1 encryption scheme (Section 6.1) according to the underlying hash function in the key derivation function and the underlying block cipher, as summarized in the following table: Hash Function Block Cipher OID MD2 DES pkcs-5.1 MD2 RC2 pkcs-5.4 MD5 DES pkcs-5.3 MD5 RC2 pkcs-5.6 SHA-1 DES pkcs-5.10 SHA-1 RC2 pkcs-5.11 pbeWithMD2AndDES-CBC OBJECT IDENTIFIER ::= {pkcs-5 1} pbeWithMD2AndRC2-CBC OBJECT IDENTIFIER ::= {pkcs-5 4} pbeWithMD5AndDES-CBC OBJECT IDENTIFIER ::= {pkcs-5 3} pbeWithMD5AndRC2-CBC OBJECT IDENTIFIER ::= {pkcs-5 6} pbeWithSHA1AndDES-CBC OBJECT IDENTIFIER ::= {pkcs-5 10} pbeWithSHA1AndRC2-CBC OBJECT IDENTIFIER ::= {pkcs-5 11} For each OID, the parameters field associated with the OID in an AlgorithmIdentifier shall have type PBEParameter: PBEParameter ::= SEQUENCE { salt OCTET STRING (SIZE(8)), iterationCount INTEGER }
Top   ToC   RFC8018 - Page 26
   The fields of type PBEParameter have the following meanings:

      -  salt specifies the salt value, an eight-octet string.

      -  iterationCount specifies the iteration count.

A.4. PBES2

The object identifier id-PBES2 identifies the PBES2 encryption scheme (Section 6.2). id-PBES2 OBJECT IDENTIFIER ::= {pkcs-5 13} The parameters field associated with this OID in an AlgorithmIdentifier shall have type PBES2-params: PBES2-params ::= SEQUENCE { keyDerivationFunc AlgorithmIdentifier {{PBES2-KDFs}}, encryptionScheme AlgorithmIdentifier {{PBES2-Encs}} } The fields of type PBES2-params have the following meanings: - keyDerivationFunc identifies the underlying key derivation function. It shall be an algorithm ID with an OID in the set PBES2-KDFs, which for this version of PKCS #5 shall consist of id-PBKDF2 (Appendix A.2). PBES2-KDFs ALGORITHM-IDENTIFIER ::= { {PBKDF2-params IDENTIFIED BY id-PBKDF2}, ... } - encryptionScheme identifies the underlying encryption scheme. It shall be an algorithm ID with an OID in the set PBES2-Encs, whose definition is left to the application. Examples of underlying encryption schemes are given in Appendix B.2. PBES2-Encs ALGORITHM-IDENTIFIER ::= { ... }

A.5. PBMAC1

The object identifier id-PBMAC1 identifies the PBMAC1 message authentication scheme (Section 7.1). id-PBMAC1 OBJECT IDENTIFIER ::= {pkcs-5 14}
Top   ToC   RFC8018 - Page 27
   The parameters field associated with this OID in an
   AlgorithmIdentifier shall have type PBMAC1-params:

   PBMAC1-params ::=  SEQUENCE {
      keyDerivationFunc AlgorithmIdentifier {{PBMAC1-KDFs}},
      messageAuthScheme AlgorithmIdentifier {{PBMAC1-MACs}} }

   The keyDerivationFunc field has the same meaning as the corresponding
   field of PBES2-params (Appendix A.4) except that the set of OIDs is
   PBMAC1-KDFs.

   PBMAC1-KDFs ALGORITHM-IDENTIFIER ::=
      { {PBKDF2-params IDENTIFIED BY id-PBKDF2}, ... }

   The messageAuthScheme field identifies the underlying message
   authentication scheme.  It shall be an algorithm ID with an OID in
   the set PBMAC1-MACs, whose definition is left to the application.
   Examples of underlying encryption schemes are given in Appendix B.3.

   PBMAC1-MACs ALGORITHM-IDENTIFIER ::= { ... }

Appendix B. Supporting Techniques

This section gives several examples of underlying functions and schemes supporting the password-based schemes in Sections 5, 6, and 7. While these supporting techniques are appropriate for applications to implement, none of them is required to be implemented. It is expected, however, that profiles for PKCS #5 will be developed that specify particular supporting techniques. This section also gives object identifiers for the supporting techniques. The object identifiers digestAlgorithm and encryptionAlgorithm identify the arcs from which certain algorithm OIDs referenced in this section are derived: digestAlgorithm OBJECT IDENTIFIER ::= {rsadsi 2} encryptionAlgorithm OBJECT IDENTIFIER ::= {rsadsi 3}
Top   ToC   RFC8018 - Page 28

B.1. Pseudorandom Functions

Examples of pseudorandom function for PBKDF2 (Section 5.2) include HMAC with SHA-1, SHA-224, SHA-256, SHA-384, SHA-512, SHA-512/224, and SHA-512/256. Applications may employ other schemes as well.

B.1.1. HMAC-SHA-1

HMAC-SHA-1 is the pseudorandom function corresponding to the HMAC message authentication code [RFC2104] based on the SHA-1 hash function [NIST180]. The pseudorandom function is the same function by which the message authentication code is computed, with a full- length output. (The first argument to the pseudorandom function PRF serves as HMAC's "key", and the second serves as HMAC's "text". In the case of PBKDF2, the "key" is thus the password and the "text" is the salt.) HMAC-SHA-1 has a variable key length and a 20-octet (160-bit) output value. Although the length of the key to HMAC-SHA-1 is essentially unbounded, the effective search space for pseudorandom function outputs may be limited by the structure of the function. In particular, when the key is longer than 512 bits, HMAC-SHA-1 will first hash it to 160 bits. Thus, even if a long derived key consisting of several pseudorandom function outputs is produced from a key, the effective search space for the derived key will be at most 160 bits. Although the specific limitation for other key sizes depends on details of the HMAC construction, one should assume, to be conservative, that the effective search space is limited to 160 bits for other key sizes as well. (The 160-bit limitation should not generally pose a practical limitation in the case of password-based cryptography, since the search space for a password is unlikely to be greater than 160 bits.) The object identifier id-hmacWithSHA1 identifies the HMAC-SHA-1 pseudorandom function: id-hmacWithSHA1 OBJECT IDENTIFIER ::= {digestAlgorithm 7} The parameters field associated with this OID in an AlgorithmIdentifier shall have type NULL. This object identifier is employed in the object set PBKDF2-PRFs (Appendix A.2). Note: Although HMAC-SHA-1 was designed as a message authentication code, its proof of security is readily modified to accommodate requirements for a pseudorandom function, under stronger assumptions. A hash function may also meet the requirements of a pseudorandom function under certain assumptions. For instance, the direct
Top   ToC   RFC8018 - Page 29
   application of a hash function to the concatenation of the "key" and
   the "text" may be appropriate, provided that "text" has appropriate
   structure to prevent certain attacks.  HMAC-SHA-1 is preferable,
   however, because it treats "key" and "text" as separate arguments and
   does not require "text" to have any structure.

   During 2004 and 2005, there were a number of attacks on SHA-1 that
   reduced its perceived effective strength against collision attacks to
   62 bits instead of the expected 80 bits (e.g., Wang et al. [WANG],
   confirmed by M. Cochran [COCHRAN]).  However, since these attacks
   centered on finding collisions between values, they are not a direct
   security consideration here because the collision-resistant property
   is not required by the HMAC authentication scheme.

B.1.2. HMAC-SHA-2

HMAC-SHA-2 refers to the set of pseudorandom functions corresponding to the HMAC message authentication code (now a FIPS standard [NIST198]) based on the new SHA-2 functions (FIPS 180-4 [NIST180]). HMAC-SHA-2 has a variable key length and variable output value depending on the hash function chosen (SHA-224, SHA-256, SHA-384, SHA-512, SHA-512/224, or SHA-512/256) -- that is, 28, 32, 48, or 64 octets. Using the new hash functions extends the search space for the produced keys. Where SHA-1 limits the search space to 20 octets, SHA-2 sets new limits of 28, 32, 48, and 64 octets. Object identifiers for HMAC are defined as follows: id-hmacWithSHA224 OBJECT IDENTIFIER ::= {digestAlgorithm 8} id-hmacWithSHA256 OBJECT IDENTIFIER ::= {digestAlgorithm 9} id-hmacWithSHA384 OBJECT IDENTIFIER ::= {digestAlgorithm 10} id-hmacWithSHA512 OBJECT IDENTIFIER ::= {digestAlgorithm 11} id-hmacWithSHA512-224 OBJECT IDENTIFIER ::= {digestAlgorithm 12} id-hmacWithSHA512-256 OBJECT IDENTIFIER ::= {digestAlgorithm 13}

B.2. Encryption Schemes

An example encryption scheme for PBES2 (Section 6.2) is AES-CBC-Pad. The schemes defined in PKCS #5 v2.0 [RFC2898], DES-CBC-Pad, DES-EDE3-CBC-Pad, RC2-CBC-Pad, and RC5-CBC-Pad, are still supported, but DES-CBC-Pad, DES-EDE3-CBC-Pad, RC2-CBC-Pad are now considered legacy and should only be used for backwards compatibility reasons. The object identifiers given in this section are intended to be employed in the object set PBES2-Encs (Appendix A.4).
Top   ToC   RFC8018 - Page 30

B.2.1. DES-CBC-Pad

DES-CBC-Pad is single-key DES [NIST46] in CBC mode [NIST81] with the padding operation specified in RFC 1423 [RFC1423] (see Section 6.1.1 of this document). DES-CBC-Pad has an eight-octet encryption key and an eight-octet initialization vector. The key is considered as a 64-bit encoding of a 56-bit DES key with parity bits ignored. The object identifier desCBC (defined in the NIST/OSI Implementors' Workshop agreements) identifies the DES-CBC-Pad encryption scheme: desCBC OBJECT IDENTIFIER ::= {iso(1) identified-organization(3) oiw(14) secsig(3) algorithms(2) 7} The parameters field associated with this OID in an AlgorithmIdentifier shall have type OCTET STRING (SIZE(8)), specifying the initialization vector for CBC mode.

B.2.2. DES-EDE3-CBC-Pad

DES-EDE3-CBC-Pad is three-key triple-DES in CBC mode [ANSIX952] with the padding operation specified in RFC 1423 [RFC1423]. DES-EDE3-CBC-Pad has a 24-octet encryption key and an eight-octet initialization vector. The key is considered as the concatenation of three eight-octet keys, each of which is a 64-bit encoding of a 56-bit DES key with parity bits ignored. The object identifier des-EDE3-CBC identifies the DES-EDE3-CBC-Pad encryption scheme: des-EDE3-CBC OBJECT IDENTIFIER ::= {encryptionAlgorithm 7} The parameters field associated with this OID in an AlgorithmIdentifier shall have type OCTET STRING (SIZE(8)), specifying the initialization vector for CBC mode. Note: An OID for DES-EDE3-CBC without padding is given in ANSI X9.52 [ANSIX952]; the one given here is preferred since it specifies padding.

B.2.3. RC2-CBC-Pad

RC2-CBC-Pad is the RC2 encryption algorithm [RFC2268] in CBC mode with the padding operation specified in RFC 1423 [RFC1423]. RC2-CBC-Pad has a variable key length, from one to 128 octets, a separate "effective key bits" parameter from one to 1024 bits that
Top   ToC   RFC8018 - Page 31
   limits the effective search space independent of the key length, and
   an eight-octet initialization vector.

   The object identifier rc2CBC identifies the RC2-CBC-Pad encryption
   scheme:

   rc2CBC OBJECT IDENTIFIER ::= {encryptionAlgorithm 2}

   The parameters field associated with OID in an AlgorithmIdentifier
   shall have type RC2-CBC-Parameter:

   RC2-CBC-Parameter ::= SEQUENCE {
       rc2ParameterVersion INTEGER OPTIONAL,
       iv OCTET STRING (SIZE(8)) }

   The fields of type RC2-CBCParameter have the following meanings:

      -  rc2ParameterVersion is a proprietary RSA Security Inc. encoding
         of the "effective key bits" for RC2.  The following encodings
         are defined:

               Effective Key Bits         Encoding
                       40                    160
                       64                    120
                      128                     58
                     b >= 256                  b

   If the rc2ParameterVersion field is omitted, the "effective key bits"
   defaults to 32.  (This is for backward compatibility with certain
   very old implementations.)

      -  iv is the eight-octet initialization vector.

B.2.4. RC5-CBC-Pad

RC5-CBC-Pad is the RC5 encryption algorithm [RC5] in CBC mode with the padding operation specified in RFC 5652 [RFC5652], which is a generalization of the padding operation specified in RFC 1423 [RFC1423]. The scheme is fully specified in [RFC2040]. RC5-CBC-Pad has a variable key length, from 0 to 256 octets, and supports both a 64-bit block size and a 128-bit block size. For the former, it has an eight-octet initialization vector, and for the latter, a 16-octet initialization vector. RC5-CBC-Pad also has a variable number of "rounds" in the encryption operation, from 8 to 127.
Top   ToC   RFC8018 - Page 32
   Note: For RC5 with a 64-bit block size, the padding string is as
   defined in RFC 1423 [RFC1423].  For RC5 with a 128-bit block size,
   the padding string consists of 16-(||M|| mod 16) octets each with
   value 16-(||M|| mod 16).

   The object identifier rc5-CBC-PAD [RFC2040] identifies the
   RC5-CBC-Pad encryption scheme:

   rc5-CBC-PAD OBJECT IDENTIFIER ::= {encryptionAlgorithm 9}

   The parameters field associated with this OID in an
   AlgorithmIdentifier shall have type RC5-CBC-Parameters:

   RC5-CBC-Parameters ::= SEQUENCE {
      version INTEGER {v1-0(16)} (v1-0),
      rounds INTEGER (8..127),
      blockSizeInBits INTEGER (64 | 128),
      iv OCTET STRING OPTIONAL }

   The fields of type RC5-CBC-Parameters have the following meanings:

      -  version is the version of the algorithm, which shall be v1-0.

      -  rounds is the number of rounds in the encryption operation,
         which shall be between 8 and 127.

      -  blockSizeInBits is the block size in bits, which shall be 64 or
         128.

      -  iv is the initialization vector, an eight-octet string for
         64-bit RC5 and a 16-octet string for 128-bit RC5.  The default
         is a string of the appropriate length consisting of zero
         octets.

B.2.5. AES-CBC-Pad

AES-CBC-Pad is the AES encryption algorithm [NIST197] in CBC mode with the padding operation specified in RFC 5652 [RFC5652]. AES-CBC-Pad has a variable key length of 16, 24, or 32 octets and has a 16-octet block size. It has a 16-octet initialization vector. Note: For AES, the padding string consists of 16-(||M|| mod 16) octets each with value 16-(||M|| mod 16). For AES, object identifiers are defined depending on key size and operation mode. For example, the 16-octet (128-bit) key AES encryption scheme in CBC mode would be aes128-CBC-Pad identifying the AES-CBC-PAD encryption scheme using a 16-octet key:
Top   ToC   RFC8018 - Page 33
   aes128-CBC-PAD OBJECT IDENTIFIER ::= {aes 2}

   The AES object identifier is defined in Appendix C.

   The parameters field associated with this OID in an
   AlgorithmIdentifier shall have type OCTET STRING (SIZE(16)),
   specifying the initialization vector for CBC mode.

B.3. Message Authentication Schemes

An example message authentication scheme for PBMAC1 (Section 7.1) is HMAC-SHA-1.

B.3.1. HMAC-SHA-1

HMAC-SHA-1 is the HMAC message authentication scheme [RFC2104] based on the SHA-1 hash function [NIST180]. HMAC-SHA-1 has a variable key length and a 20-octet (160-bit) message authentication code. The object identifier id-hmacWithSHA1 (see Appendix B.1.1) identifies the HMAC-SHA-1 message authentication scheme. (The object identifier is the same for both the pseudorandom function and the message authentication scheme; the distinction is to be understood by context.) This object identifier is intended to be employed in the object set PBMAC1-Macs (Appendix A.5).

B.3.2. HMAC-SHA-2

HMAC-SHA-2 refers to the set of HMAC message authentication schemes [NIST198] based on the SHA-2 functions [NIST180]. HMAC-SHA-2 has a variable key length and a message authentication code whose length is based on the hash function chosen (SHA-224, SHA-256, SHA-384, SHA-512, SHA-512/224, or SHA-512/256) -- that is, 28, 32, 48, or 64 octets. The object identifiers id-hmacWithSHA224, id-hmacWithSHA256, id-hmacWithSHA384, id-hmacWithSHA512, id-hmacWithSHA512-224, and id-hmacWithSHA512-256 (see Appendix B.1.2) identify the HMAC-SHA-2 schemes. The object identifiers are the same for both the pseudorandom functions and the message authentication schemes; the distinction is to be understood by context. These object identifiers are intended to be employed in the object set PBMAC1-Macs (Appendix A.5).
Top   ToC   RFC8018 - Page 34

Appendix C. ASN.1 Module

For reference purposes, the ASN.1 syntax in the preceding sections is presented as an ASN.1 module here. -- PKCS #5 v2.1 ASN.1 Module -- Revised October 27, 2012 -- This module has been checked for conformance with the -- ASN.1 standard by the OSS ASN.1 Tools PKCS5v2-1 { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-5(5) modules(16) pkcs5v2-1(2) } DEFINITIONS EXPLICIT TAGS ::= BEGIN -- ======================== -- Basic object identifiers -- ======================== nistAlgorithms OBJECT IDENTIFIER ::= {joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) 4} oiw OBJECT IDENTIFIER ::= {iso(1) identified-organization(3) 14} rsadsi OBJECT IDENTIFIER ::= {iso(1) member-body(2) us(840) 113549} pkcs OBJECT IDENTIFIER ::= {rsadsi 1} pkcs-5 OBJECT IDENTIFIER ::= {pkcs 5} -- ======================= -- Basic types and classes -- ======================= AlgorithmIdentifier { ALGORITHM-IDENTIFIER:InfoObjectSet } ::= SEQUENCE { algorithm ALGORITHM-IDENTIFIER.&id({InfoObjectSet}), parameters ALGORITHM-IDENTIFIER.&Type({InfoObjectSet} {@algorithm}) OPTIONAL } ALGORITHM-IDENTIFIER ::= TYPE-IDENTIFIER -- ====== -- PBKDF2 -- ======
Top   ToC   RFC8018 - Page 35
   PBKDF2Algorithms ALGORITHM-IDENTIFIER ::= {
      {PBKDF2-params IDENTIFIED BY id-PBKDF2},
      ...
   }

   id-PBKDF2 OBJECT IDENTIFIER ::= {pkcs-5 12}

   algid-hmacWithSHA1 AlgorithmIdentifier {{PBKDF2-PRFs}} ::=
      {algorithm id-hmacWithSHA1, parameters NULL : NULL}

   PBKDF2-params ::= SEQUENCE {
       salt CHOICE {
         specified OCTET STRING,
         otherSource AlgorithmIdentifier {{PBKDF2-SaltSources}}
       },
       iterationCount INTEGER (1..MAX),
       keyLength INTEGER (1..MAX) OPTIONAL,
       prf AlgorithmIdentifier {{PBKDF2-PRFs}} DEFAULT
       algid-hmacWithSHA1
   }

   PBKDF2-SaltSources ALGORITHM-IDENTIFIER ::= { ... }

   PBKDF2-PRFs ALGORITHM-IDENTIFIER ::= {
     {NULL IDENTIFIED BY id-hmacWithSHA1},
     {NULL IDENTIFIED BY id-hmacWithSHA224},
     {NULL IDENTIFIED BY id-hmacWithSHA256},
     {NULL IDENTIFIED BY id-hmacWithSHA384},
     {NULL IDENTIFIED BY id-hmacWithSHA512},
     {NULL IDENTIFIED BY id-hmacWithSHA512-224},
     {NULL IDENTIFIED BY id-hmacWithSHA512-256},
     ...
   }

   -- =====
   -- PBES1
   -- =====

   PBES1Algorithms ALGORITHM-IDENTIFIER ::= {
      {PBEParameter IDENTIFIED BY pbeWithMD2AndDES-CBC}  |
      {PBEParameter IDENTIFIED BY pbeWithMD2AndRC2-CBC}  |
      {PBEParameter IDENTIFIED BY pbeWithMD5AndDES-CBC}  |
      {PBEParameter IDENTIFIED BY pbeWithMD5AndRC2-CBC}  |
      {PBEParameter IDENTIFIED BY pbeWithSHA1AndDES-CBC} |
      {PBEParameter IDENTIFIED BY pbeWithSHA1AndRC2-CBC},
      ...
   }
Top   ToC   RFC8018 - Page 36
   pbeWithMD2AndDES-CBC OBJECT IDENTIFIER ::= {pkcs-5 1}
   pbeWithMD2AndRC2-CBC OBJECT IDENTIFIER ::= {pkcs-5 4}
   pbeWithMD5AndDES-CBC OBJECT IDENTIFIER ::= {pkcs-5 3}
   pbeWithMD5AndRC2-CBC OBJECT IDENTIFIER ::= {pkcs-5 6}
   pbeWithSHA1AndDES-CBC OBJECT IDENTIFIER ::= {pkcs-5 10}
   pbeWithSHA1AndRC2-CBC OBJECT IDENTIFIER ::= {pkcs-5 11}

   PBEParameter ::= SEQUENCE {
       salt OCTET STRING (SIZE(8)),
       iterationCount INTEGER
   }

   -- =====
   -- PBES2
   -- =====

   PBES2Algorithms ALGORITHM-IDENTIFIER ::= {
      {PBES2-params IDENTIFIED BY id-PBES2},
      ...
   }

   id-PBES2 OBJECT IDENTIFIER ::= {pkcs-5 13}

   PBES2-params ::= SEQUENCE {
      keyDerivationFunc AlgorithmIdentifier {{PBES2-KDFs}},
      encryptionScheme AlgorithmIdentifier {{PBES2-Encs}}
   }

   PBES2-KDFs ALGORITHM-IDENTIFIER ::= {
      {PBKDF2-params IDENTIFIED BY id-PBKDF2},
      ...
   }

   PBES2-Encs ALGORITHM-IDENTIFIER ::= { ... }

   -- ======
   -- PBMAC1
   -- ======

   PBMAC1Algorithms ALGORITHM-IDENTIFIER ::= {
      {PBMAC1-params IDENTIFIED BY id-PBMAC1},
      ...
   }

   id-PBMAC1 OBJECT IDENTIFIER ::= {pkcs-5 14}

   PBMAC1-params ::=  SEQUENCE {
       keyDerivationFunc AlgorithmIdentifier {{PBMAC1-KDFs}},
Top   ToC   RFC8018 - Page 37
       messageAuthScheme AlgorithmIdentifier {{PBMAC1-MACs}}
   }

   PBMAC1-KDFs ALGORITHM-IDENTIFIER ::= {
      {PBKDF2-params IDENTIFIED BY id-PBKDF2},
      ...
   }

   PBMAC1-MACs ALGORITHM-IDENTIFIER ::= { ... }

   -- =====================
   -- Supporting techniques
   -- =====================

   digestAlgorithm OBJECT IDENTIFIER     ::= {rsadsi 2}
   encryptionAlgorithm OBJECT IDENTIFIER ::= {rsadsi 3}

   SupportingAlgorithms ALGORITHM-IDENTIFIER ::= {
      {NULL IDENTIFIED BY id-hmacWithSHA1}                   |
      {OCTET STRING (SIZE(8)) IDENTIFIED BY desCBC}          |
      {OCTET STRING (SIZE(8)) IDENTIFIED BY des-EDE3-CBC}    |
      {RC2-CBC-Parameter IDENTIFIED BY rc2CBC}               |
      {RC5-CBC-Parameters IDENTIFIED BY rc5-CBC-PAD},        |
      {OCTET STRING (SIZE(16)) IDENTIFIED BY aes128-CBC-PAD} |
      {OCTET STRING (SIZE(16)) IDENTIFIED BY aes192-CBC-PAD} |
      {OCTET STRING (SIZE(16)) IDENTIFIED BY aes256-CBC-PAD},
       ...
   }

   id-hmacWithSHA1 OBJECT IDENTIFIER ::= {digestAlgorithm 7}
   id-hmacWithSHA224 OBJECT IDENTIFIER ::= {digestAlgorithm 8}
   id-hmacWithSHA256 OBJECT IDENTIFIER ::= {digestAlgorithm 9}
   id-hmacWithSHA384 OBJECT IDENTIFIER ::= {digestAlgorithm 10}
   id-hmacWithSHA512 OBJECT IDENTIFIER ::= {digestAlgorithm 11}
   id-hmacWithSHA512-224 OBJECT IDENTIFIER ::= {digestAlgorithm 12}
   id-hmacWithSHA512-256 OBJECT IDENTIFIER ::= {digestAlgorithm 13}

   desCBC OBJECT IDENTIFIER ::= {oiw secsig(3) algorithms(2) 7}

   des-EDE3-CBC OBJECT IDENTIFIER ::= {encryptionAlgorithm 7}

   rc2CBC OBJECT IDENTIFIER ::= {encryptionAlgorithm 2}

   RC2-CBC-Parameter ::= SEQUENCE {
      rc2ParameterVersion INTEGER OPTIONAL,
      iv OCTET STRING (SIZE(8))
   }
Top   ToC   RFC8018 - Page 38
   rc5-CBC-PAD OBJECT IDENTIFIER ::= {encryptionAlgorithm 9}

   RC5-CBC-Parameters ::= SEQUENCE {
      version INTEGER {v1-0(16)} (v1-0),
      rounds INTEGER (8..127),
      blockSizeInBits INTEGER (64 | 128),
      iv OCTET STRING OPTIONAL
   }

   aes OBJECT IDENTIFIER ::= { nistAlgorithms 1 }
   aes128-CBC-PAD OBJECT IDENTIFIER ::= { aes 2 }
   aes192-CBC-PAD OBJECT IDENTIFIER ::= { aes 22 }
   aes256-CBC-PAD OBJECT IDENTIFIER ::= { aes 42 }

   END

Appendix D. Revision History of PKCS #5

Versions 1.0 - 1.3 Versions 1.0 - 1.3 were distributed to participants in RSA Data Security Inc.'s Public-Key Cryptography Standards meetings in February and March 1991. Version 1.4 Version 1.4 was part of the June 3, 1991 initial public release of PKCS. Version 1.4 was published as NIST/OSI Implementors' Workshop document SEC-SIG-91-20. Version 1.5 Version 1.5 incorporated several editorial changes, including updates to the references and the addition of a revision history. Version 2.0 Version 2.0 incorporates major editorial changes in terms of the document structure, and introduces the PBES2 encryption scheme, the PBMAC1 message authentication scheme, and independent password-based key derivation functions. This version continues to support the encryption process in version 1.5.
Top   ToC   RFC8018 - Page 39
   Version 2.1

      This document transfers PKCS #5 into the IETF and includes some
      minor changes from the authors for this submission.

      o  Introduces AES/CBC as an encryption scheme for PBES2 and HMAC
         with the hash functions SHA-224, SHA-256, SHA-384, SHA-512,
         SHA-512/224, and SHA-512/256 as pseudorandom functions for
         PBKDF2 and message authentication schemes for PBMAC1.

      o  Changes references for PKCS #5 to RFC 2898 and for PKCS #8 to
         RFCs 5208 and 5898.

      o  Incorporates corrections of two editorial errata reported on
         PKCS #5 [RFC2898].

      o  Added security considerations for MD2, MD5, and SHA-1.

Appendix E. About PKCS

The Public-Key Cryptography Standards are specifications produced by RSA Laboratories in cooperation with secure systems developers worldwide for the purpose of accelerating the deployment of public- key cryptography. First published in 1991 as a result of meetings with a small group of early adopters of public-key technology, the PKCS documents have become widely referenced and implemented. Contributions from the PKCS series have become part of many formal and de facto standards, including ANSI X9 documents, PKIX, Secure Electronic Transaction (SET), S/MIME, and SSL. Further development of most PKCS documents occurs through the IETF. Suggestions for improvement are welcome.
Top   ToC   RFC8018 - Page 40

Acknowledgements

This document is based on a contribution of RSA Laboratories, the research center of RSA Security Inc. RC2 and RC5 are trademarks of EMC Corporation.

Authors' Addresses

Kathleen M. Moriarty (editor) Dell EMC 176 South Street Hopkinton, MA 01748 United States of America Email: Kathleen.Moriarty@Dell.com Burt Kaliski Verisign 12061 Bluemont Way Reston, VA 20190 United States of America Email: bkaliski@verisign.com URI: http://verisignlabs.com Andreas Rusch RSA 345 Queen Street Brisbane, QLD 4000 Australia Email: andreas.rusch@rsa.com