Draft sp800 135
Draft sp800 135
COMPUTER SECURITY
August 2010
Abstract
Cryptographic keys are vital to the security of internet security applications and
protocols. Many widely-used internet security protocols have their own application-
specific Key Derivation Functions (KDFs) that are used to generate the cryptographic
keys required for their cryptographic functions. This Recommendation provides security
requirements for those KDFs.
KEY WORDS: Cryptographic key, shared secret, Diffie-Hellman (DH) key exchange,
hash function, Key Derivation Function (KDF), Hash-based Key Derivation Function
(HKDF), Randomness Extraction, Key Expansion , Pseudorandom Function (PRF),
HMAC, ANS X9.42-2001, ANS X9.63-2001, IKE, SSH, TLS, SRTP and SNMP, TPM.
ii
DRAFT NIST SP 800-135
Acknowledgements
iii
DRAFT NIST SP 800-135
Table of Contents
1 Introduction........................................................................................ 2
2 Authority ............................................................................................ 2
3 Glossary of Terms, Acronyms and Mathematical Symbols .............. 3
3.1 Terms and Definitions.............................................................................. 3
3.2 Acronyms................................................................................................. 5
3.3 Symbols & Mathematical Operations...................................................... 5
4 Extraction-then-Expansion (E-E) Procedure ..................................... 6
4.1 Internet Key Exchange (IKE) .................................................................. 8
4.1.1 IKE version 1 (IKEv1)................................................................. 8
4.1.2 IKE version 2 (IKEv2)................................................................. 9
4.2 Key Derivation in Transport Layer Security (TLS)............................... 10
4.2.1 Key Derivation in TLS versions 1.0 and 1.1 ............................. 10
4.2.2 Key Derivation in TLS version 1.2............................................ 11
5 Other Existing Key Derivation Functions ....................................... 12
5.1 Key Derivation Functions in American National Standards (ANS)
X9.42-2001 and ANS X9.63-2001 .................................................................... 13
5.2 Secure Shell (SSH) Key Derivation Function ....................................... 13
5.3 The Secure Real-time Transport Protocol (SRTP) Key Derivation
Function ............................................................................................................. 16
5.4 Simple Network Management Protocol (SNMP) Key Derivation
Function/Key Localization Function ................................................................. 17
5.5 Trusted Platform Module (TPM) Key Derivation Function .................. 18
6 References........................................................................................ 20
1
DRAFT NIST SP 800-135
1 Introduction
This document specifies security requirements for existing application-specific key
derivation functions in:
• American National Standard (ANS) X9.42-2001-Public Key Cryptography for the
Financial Services Industry: Agreement of Symmetric Keys Using Discrete
Logarithm Cryptography [ANS X9.42] (also in RFC 2631 [RFC 2631]),
• American National Standard (ANS) X9.63-2001-Public Key Cryptography for the
Financial Services Industry: Key Agreement and Key Transport Using Elliptic
Curve Cryptography [ANS X9.63] (also in RFC 3278 [RFC 3278]),
• Internet Key Exchange (IKE) (versions 1: RFC 2409 [RFC 2409] and version 2:
RFC 4306 [RFC 4306]),
• Secure Shell (SSH): RFC 4253 [RFC 4253],
• Transport Layer Security (TLS) versions 1.0: RFC 2246 [RFC 2246] and version
1.1: RFC 4346 [RFC 4346],
• The Secure Real-time Transport Protocol (SRTP) [RFC 3711],
• User-based Security Model (USM) for version 3 of the Simple Network
Management Protocol (SNMP) [RFC 2574], and
• Trusted Platform Module (TPM) [TPM Principles, TPM Structures and TPM
Commands].
2 Authority
This Recommendation has been developed by the National Institute of Standards and
Technology (NIST) in furtherance of its statutory responsibilities under the Federal
Information Security Management Act (FISMA) of 2002, Public Law 107-347.
NIST is responsible for developing standards and guidelines, including minimum
requirements, for providing adequate information security for all agency operations and
assets, but such standards and guidelines shall not apply to national security systems.
This recommendation is consistent with the requirements of the Office of Management
and Budget (OMB) Circular A-130, Section 8b(3), Securing Agency Information
2
DRAFT NIST SP 800-135
3
DRAFT NIST SP 800-135
4
DRAFT NIST SP 800-135
3.2 Acronyms
AES(k, input) A single AES encryption operation as specified in [FIPS 197] with k and
input being AES encryption key and 1 block (128 bits) plaintext/data
respectively.
5
DRAFT NIST SP 800-135
X-OR The equivalent of (A ⊕ B). See the definition of the bitwise logical
operation ⊕ above.
Pre-shared-key A secret key that has previously been established. See “pre-shared key”
in Section 3.1 above.
6
DRAFT NIST SP 800-135
and SP 800-56B [SP 800-56B]. Figure 1 below shows the relationship of the E-E
procedure in [SP 800-56C] with the approved KDFs in [SP 800-108]. Note that other
approved KDFs using approved hash functions are specified in [SP 800-56A] and [SP
800-56B]. In Figure 1, the extraction step outputs a key derivation key, which is then
used as input to the expansion step. Any approved KDFs in SP 800-108 can be used as
the expansion step that derives keying material. The following sections discuss protocols
that use the E-E procedure.
Key Agreement
Primitive
Shared Secret
Extraction
Step
K Key
SP 800‐56C Derivation
E‐E Procedure Key
Expansion SP 800‐108
Step KDF
SP 800‐108
KDF KDF
7
DRAFT NIST SP 800-135
CKY-I and CKY-R are non-secret values. The technical details of these variables are
provided in RFC 2409 [RFC 2409]. Figure 2 below shows the feedback function that
produces the SKEYID_d, SKEYID_a and SKEYID_e above. This function conforms to the
specification of a KDF in SP 800-108 [SP 800-108] and the specification of the
expansion step in SP 800-56C [SP 800-56C].
8
DRAFT NIST SP 800-135
SKEYID
gxy || CKY-I || CKY-R
Note that both SKEYID and the Diffie-Hellman shared secret gxy are secret values and are
used as inputs to the HMAC in the expansion step. Also note that all three resulting keys
(i.e., SKEYID_d, SKEYID_a and SKEYID_e) are pseudorandom keys.
SKEYID_a is used as an HMAC key to authenticate the current security association’s
messages.
SKEYID_d is used as the key derivation key to generate fresh keying material for new,
negotiated security associations.
SKEYID_e is used as a key derivation key to derive a symmetric encryption key to
provide confidentiality for the current SA’s messages. More details about this function
can be found in Appendix B of RFC 2409 [RFC 2409].
The IKEv1 KDFs are approved when the following conditions are satisfied:
(1) The IKEv1 KDFs are performed in the context of the IKEv1 protocol.
(2) The PRF is an HMAC-based PRF.
(3) The HMAC and HASH are NIST-approved algorithms and are used as specified
in FIPSs 198-1 [FIPS 198-1] and 180-3 [FIPS 180-3], respectively.
9
DRAFT NIST SP 800-135
After the SKEYSEED is generated, an expansion step is used to derive keys for the
security association (SA). SKEYSEED is the key derivation key for the expansion step.
The string of concatenated non-secret attributes: Ni || Nr || SPIi || SPIr 1 is the P field in
SP 800-56C. Information about these non-secret attributes can be found in RFC 4306
[RFC 4306]. The specification of the expansion step can be found in Sections 2.13 and
2.14 of the RFC. Note that as shown in Figure 1, the keying material generated by this
expansion step is the output of the E-E procedure.
One of the seven secret keys derived from the SKEYSEED is called SK_d. It is used as the
key derivation key to derive new keys for child SA(s) using another KDF that is
functionally the same as the expansion step, but with a different set of attributes.
One of the attributes is an optional new Diffie-Hellman shared secret established during
the creation of the child SA. Details of this function can be found in Sections 2.17 and
2.18 of the RFC.
The IKEv2 KDFs are approved when the following conditions are satisfied:
(1) The IKEv2 KDFs are performed in the context of the IKEv2 protocol.
(2) The PRF is an HMAC-based PRF.
(3) The HMAC and HASH are NIST-approved algorithms and are used as specified
in FIPSs 198-1 [FIPS 198-1] and 180-3 [FIPS 180-3], respectively.
1
Ni and Nr are nonces created by the initiator and responder, respectively. SPIi and SPIr are security
parameter indexes (SPIs) of the initiator and responder respectively.
2
The HMAC-MD5/HMAC-SHA-1 PRF uses HMAC-MD5 and HMAC-SHA-1 as the core functions in its
construction, as specified in RFC 2246 [RFC 2246], Section 5.
10
DRAFT NIST SP 800-135
specifications of P_MD5 and P_SHA-1 are in Section 5 of RFC 2246 [RFC 2246] (the
function called P_hash in the RFC). The P_HASH function (P_MD5 or P_SHA-1) uses
the double-pipeline iteration mode and HMAC-PRF specified in SP 800-108 [SP 800-
108].
The outputs from both P_MD5 and P_SHA-1 are X-ORed together to produce the PRF
output. This PRF is used as both an extraction step to generate the master secret and as an
expansion step to derive keying material for the protocol from the master secret.
The TLS 1.0 and 1.1 KDF is approved when the following conditions are satisfied:
(1) The TLS 1.0 and 1.1 KDF is performed in the context of the TLS protocol.
(2) SHA-1 and HMAC are as specified in FIPSs 180-3 and 198-1, respectively.
Note that MD5 and HMAC-MD5 shall not be used as a general hash function or HMAC
function, respectively.
3
The HMAC-SHA-256 PRF uses HMAC-SHA-256 as the core function in its construction, as specified in
RFC 5246 [RFC 5246], Section 5.
11
DRAFT NIST SP 800-135
Shared Secret
Application
‐Specific
K
KDF
12
DRAFT NIST SP 800-135
Output from a key exchange 4 (see Section 7.2 of RFC 4253) in the Transport Layer
Protocol is a shared secret, “K”, and a hash value, “H”. In the protocol, K, H and a
specific set of other non-secret values are input to a hash function-based KDF to derive
keying material. Different KDFs produce keying material for different cryptographic
functions; however, the KDFs are similar (see below). The specifications for the KDFs
in the Transport Layer Protocol can be found in Section 7.2 of RFC 4253.
4
The key exchange method specified for the protocol is one of the key agreement primitives described in
[SP 800-56A].
13
DRAFT NIST SP 800-135
The following is a description of the KDF used to derive a key, where HASH denotes a
hash function, such as SHA-1 or SHA-256 as specified in FIPS 180-3. The desired key is
denoted by KEY, and the length of KEY is denoted by L. The length of the hash function
output is denoted by HASH_Length.
If N > 1
{
i =2;
While (i ≤ N)
{
j = i – 1;
Ki = HASH (K || H || Concatenation);
i + 1;
}
Figure 4 below shows the accumulative and feedback operation of the KDF.
5
session_id is actually H from the first key exchange and remains unchanged for the whole connection.
However, K and H will be changed when a key re-exchange is performed, see Section 9 of [RFC 4253].
14
DRAFT NIST SP 800-135
K1
K || H || X || session_id
K2
K || H || K1
K || H || K1|| K2
. K(N-1)
.
…
KN
K || H || K1|| K2||…|K(N-1)
15
DRAFT NIST SP 800-135
Each box in Figure 4 represents a hash function computation. The variables in the box are
input to the hash function. The arrow ( → ) indicates an output from the hash function.
The SSH KDFs are approved when the following conditions are satisfied:
(1) They are performed in the context of the SSH protocol.
(2) The hash function is one of the hash functions specified in FIPS 180-3 [FIPS 180-
3].
(3) The hash function deployed in the KDFs meets the security strength(s) required
by the cryptographic function(s) for which the keying material is being generated.
The security strengths of approved hash functions used in KDFs can be found in
[SP 800-57].
Denote a cryptographic key (encryption key, cipher salt or authentication key (HMAC
key), etc…) to be derived to be K. Below is a description of the KDF.
kdr: the key derivation rate. kdr is a number from the set {0, 1, 21, 22, 23…,224),
represented as a 48-bit value.
index: an integer. See RFC 3711 for technical details about “index”.
label: an 8-bit value represented by two hexadecimal numbers from the set of {0x01,
0x02, 0x03, 0x04, 0x05, 0x06}. In the future, this set might also include any or all of the
values 0x06, 0x07,…,0xff.
16
DRAFT NIST SP 800-135
The input is used as input to AES-128 to produce a session encryption key, cipher salt or
authentication key, with k_master being the encryption key.
For i = 0 to (m – 1) (m can be 1)
{
The SRTP KDF is approved when the following conditions are satisfied:
6
One of the SNMP engines involved in each communication is designated to be the authoritative SNMP
engine, see RFC 2574 [RFC 2574] Section 1.5.1 for details.
17
DRAFT NIST SP 800-135
Call Shared_key to be the key that the user shares with the authoritative SNMP engine
with ID snmpEngineID. The Shared_key is generated as follow:
The USM KDF is approved when the following conditions are satisfied:
(1) It is performed in the context of the SNMP protocol.
(2) SHA-1 (as specified in FIPS 180-3 [FIPS 180-3]) is used in the key localization
function.
18
DRAFT NIST SP 800-135
(1) The TPM KDF is performed in the context of a TPM session (i.e. performed
between a TPM and an application with a shared authorization value.)
(2) HMAC and SHA-1 are used as specified in FIPS 198-1 [FIPS 198-1] and 180-3
[FIPS 180-3], respectively.
Note that the KDF is a particular instance of the feedback mode as specified in Section
5.2 of SP 800-108 [SP 800-108], with an empty initial value (IV).
19
DRAFT NIST SP 800-135
6 References
[FIPS 197] Federal Information Processing Standard 197, Advanced
Encryption Standard (AES), November 2001.
[FIPS 180-3] Federal Information Processing Standard 180-3, Secure
Hash Standard (SHS), October 2008.
[FIPS 198-1] Federal Information Processing Standard 198-1, The
Keyed-Hash Message Authentication Code (HMAC),
July 2008.
[Krawczyk] H. Krawczyk, On Extract-then-Expand Key Derivation
Functions and an HMAC-based KDF,
(http://www.ee.technion.ac.il/~hugo/kdf/), March 2008.
[ANS X9.42] NIST ANS X9.42-2001, Public Key Cryptography for
the Financial Services Industry: Agreement of Symmetric
Keys Using Discrete Logarithm Cryptography, 2005.
[ANS X9.63] ANS X9.63-2001, Public Key Cryptography for the
Financial Services Industry: Key Agreement and Key
Transport Using Elliptic Curve Cryptography.
[RFC 2246] T. Dierks and C. Allen, The TLS Protocol Version 1.0,
RFC 2246, January 1999.
[RFC 2409] D. Harkins and D. Carrel, The Internet Key Exchange
(IKE), RFC 2409, November 1998.
[RFC 2571] D. Harrington, R. Presuhn and B. Wijnen, An
Architecture for Describing SNMP Management
Frameworks, RFC 2571, April 1999.
[RFC 2574] U. Blumenthal and B. Wijnen, User-based Security
Model (USM) for version 3 of the Simple Network
Management Protocol (SNMPv3), RFC 2574, April 1999.
[RFC 2631] E. Rescorla, “Diffie-Hellman Key Agreement Method”,
RFC 2631, June 1999.
[RFC 3278] S. Blake-Wilson, D. Brown and P. Lambert, Use of
Elliptic Curve Cryptography (ECC) Algorithms in
Cryptographic Message Syntax (CMS), RFC 3278, April
2002.
[RFC 3550] H. Schulzrinne, S. Casner, R. Frederick and V. Jacobson,
RTP: A Transport Protocol for Real-Time Applications,
RFC 3550, July 2003.
20
DRAFT NIST SP 800-135
21
DRAFT NIST SP 800-135
22