6070
INFORMATIONAL
PKCS #5: Password-Based Key Derivation Function 2 (PBKDF2) Test Vectors
Authors: S. Josefsson
Date: January 2011
Working Group: NON WORKING GROUP
Stream: IETF
Abstract
This document contains test vectors for the Public-Key Cryptography Standards (PKCS) #5 Password-Based Key Derivation Function 2 (PBKDF2) with the Hash-based Message Authentication Code (HMAC) Secure Hash Algorithm (SHA-1) pseudorandom function. This document is not an Internet Standards Track specification; it is published for informational purposes.
RFC 6070
INFORMATIONAL
Internet Engineering Task Force (IETF) S. Josefsson
Request for Comments: 6070 SJD AB
Category: Informational January 2011
ISSN: 2070-1721
<span class="h1">PKCS #5: Password-Based Key Derivation Function 2 (PBKDF2)</span>
<span class="h1">Test Vectors</span>
Abstract
This document contains test vectors for the Public-Key Cryptography
Standards (PKCS) #5 Password-Based Key Derivation Function 2 (PBKDF2)
with the Hash-based Message Authentication Code (HMAC) Secure Hash
Algorithm (SHA-1) pseudorandom function.
Status of This Memo
This document is not an Internet Standards Track specification; it is
published for informational purposes.
This document is a product of the Internet Engineering Task Force
(IETF). It represents the consensus of the IETF community. It has
received public review and has been approved for publication by the
Internet Engineering Steering Group (IESG). Not all documents
approved by the IESG are a candidate for any level of Internet
Standard; see <a href="./rfc5741#section-2">Section 2 of RFC 5741</a>.
Information about the current status of this document, any errata,
and how to provide feedback on it may be obtained at
<a href="https://www.rfc-editor.org/info/rfc6070">http://www.rfc-editor.org/info/rfc6070</a>.
Copyright Notice
Copyright (c) 2011 IETF Trust and the persons identified as the
document authors. All rights reserved.
This document is subject to <a href="https://www.rfc-editor.org/bcp/bcp78">BCP 78</a> and the IETF Trust's Legal
Provisions Relating to IETF Documents
(<a href="http://trustee.ietf.org/license-info">http://trustee.ietf.org/license-info</a>) in effect on the date of
publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License.
<span class="grey">Josefsson Informational [Page 1]</span>
<span id="page-2" ></span>
<span class="grey"><a href="./rfc6070">RFC 6070</a> PKCS #5 PBKDF2 Test Vectors January 2011</span>
Table of Contents
<a href="#section-1">1</a>. Introduction ....................................................<a href="#page-2">2</a>
<a href="#section-2">2</a>. PBKDF2 HMAC-SHA1 Test Vectors ...................................<a href="#page-2">2</a>
<a href="#section-3">3</a>. Acknowledgements ................................................<a href="#page-4">4</a>
<a href="#section-4">4</a>. Copying Conditions ..............................................<a href="#page-4">4</a>
<a href="#section-5">5</a>. Security Considerations .........................................<a href="#page-4">4</a>
<a href="#section-6">6</a>. References ......................................................<a href="#page-4">4</a>
<a href="#section-6.1">6.1</a>. Normative References .......................................<a href="#page-4">4</a>
<a href="#section-6.2">6.2</a>. Informative References .....................................<a href="#page-5">5</a>
<span class="h2"><a class="selflink" id="section-1" href="#section-1">1</a>. Introduction</span>
The Public-Key Cryptography Standards (PKCS) #5 [<a href="./rfc2898" title=""PKCS #5: Password-Based Cryptography Specification Version 2.0"">RFC2898</a>] Password-
Based Key Derivation Function 2 (PBKDF2) is used by several protocols
to derive encryption keys from a password.
For example, Salted Challenge Response Authentication Mechanism
(SCRAM) [<a href="./rfc5802" title=""Salted Challenge Response Authentication Mechanism (SCRAM) SASL and GSS-API Mechanisms"">RFC5802</a>] uses PBKDF2 with Hash-based Message Authentication
Code (HMAC) [<a href="./rfc2104" title=""HMAC: Keyed- Hashing for Message Authentication"">RFC2104</a>] and Secure Hash Algorithm (SHA-1)
[<a href="#ref-FIPS.180-1.1995">FIPS.180-1.1995</a>].
Test vectors for the algorithm were not included in the original
specification, but are often useful for implementers. This document
addresses the shortcoming.
<span class="h2"><a class="selflink" id="section-2" href="#section-2">2</a>. PBKDF2 HMAC-SHA1 Test Vectors</span>
The input strings below are encoded using ASCII [<a href="#ref-ANSI.X3-4.1986">ANSI.X3-4.1986</a>].
The sequence "\0" (without quotation marks) means a literal ASCII NUL
value (1 octet). "DK" refers to the Derived Key.
Input:
P = "password" (8 octets)
S = "salt" (4 octets)
c = 1
dkLen = 20
Output:
DK = 0c 60 c8 0f 96 1f 0e 71
f3 a9 b5 24 af 60 12 06
2f e0 37 a6 (20 octets)
<span class="grey">Josefsson Informational [Page 2]</span>
<span id="page-3" ></span>
<span class="grey"><a href="./rfc6070">RFC 6070</a> PKCS #5 PBKDF2 Test Vectors January 2011</span>
Input:
P = "password" (8 octets)
S = "salt" (4 octets)
c = 2
dkLen = 20
Output:
DK = ea 6c 01 4d c7 2d 6f 8c
cd 1e d9 2a ce 1d 41 f0
d8 de 89 57 (20 octets)
Input:
P = "password" (8 octets)
S = "salt" (4 octets)
c = 4096
dkLen = 20
Output:
DK = 4b 00 79 01 b7 65 48 9a
be ad 49 d9 26 f7 21 d0
65 a4 29 c1 (20 octets)
Input:
P = "password" (8 octets)
S = "salt" (4 octets)
c = 16777216
dkLen = 20
Output:
DK = ee fe 3d 61 cd 4d a4 e4
e9 94 5b 3d 6b a2 15 8c
26 34 e9 84 (20 octets)
Input:
P = "passwordPASSWORDpassword" (24 octets)
S = "saltSALTsaltSALTsaltSALTsaltSALTsalt" (36 octets)
c = 4096
dkLen = 25
Output:
DK = 3d 2e ec 4f e4 1c 84 9b
80 c8 d8 36 62 c0 e4 4a
8b 29 1a 96 4c f2 f0 70
38 (25 octets)
<span class="grey">Josefsson Informational [Page 3]</span>
<span id="page-4" ></span>
<span class="grey"><a href="./rfc6070">RFC 6070</a> PKCS #5 PBKDF2 Test Vectors January 2011</span>
Input:
P = "pass\0word" (9 octets)
S = "sa\0lt" (5 octets)
c = 4096
dkLen = 16
Output:
DK = 56 fa 6a a7 55 48 09 9d
cc 37 d7 f0 34 25 e0 c3 (16 octets)
<span class="h2"><a class="selflink" id="section-3" href="#section-3">3</a>. Acknowledgements</span>
Barry Brachman and Love Hornquist Astrand confirmed the test vectors
(using independent implementations) and pointed out a mistake in the
salt octet length count.
<span class="h2"><a class="selflink" id="section-4" href="#section-4">4</a>. Copying Conditions</span>
This document should be considered a Code Component and is thus
available under the BSD license.
<span class="h2"><a class="selflink" id="section-5" href="#section-5">5</a>. Security Considerations</span>
The security considerations in [<a href="./rfc2898" title=""PKCS #5: Password-Based Cryptography Specification Version 2.0"">RFC2898</a>] apply. This document does
not introduce any new security considerations.
<span class="h2"><a class="selflink" id="section-6" href="#section-6">6</a>. References</span>
<span class="h3"><a class="selflink" id="section-6.1" href="#section-6.1">6.1</a>. Normative References</span>
[<a id="ref-ANSI.X3-4.1986">ANSI.X3-4.1986</a>]
American National Standards Institute, "Coded Character
Set - 7-bit American Standard Code for Information
Interchange", ANSI X3.4, 1986.
[<a id="ref-RFC2104">RFC2104</a>] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed-
Hashing for Message Authentication", <a href="./rfc2104">RFC 2104</a>,
February 1997.
[<a id="ref-RFC2898">RFC2898</a>] Kaliski, B., "PKCS #5: Password-Based Cryptography
Specification Version 2.0", <a href="./rfc2898">RFC 2898</a>, September 2000.
[<a id="ref-FIPS.180-1.1995">FIPS.180-1.1995</a>]
National Institute of Standards and Technology, "Secure
Hash Standard", FIPS PUB 180-1, April 1995,
<<a href="http://www.itl.nist.gov/fipspubs/fip180-1.htm">http://www.itl.nist.gov/fipspubs/fip180-1.htm</a>>.
<span class="grey">Josefsson Informational [Page 4]</span>
<span id="page-5" ></span>
<span class="grey"><a href="./rfc6070">RFC 6070</a> PKCS #5 PBKDF2 Test Vectors January 2011</span>
<span class="h3"><a class="selflink" id="section-6.2" href="#section-6.2">6.2</a>. Informative References</span>
[<a id="ref-RFC5802">RFC5802</a>] Newman, C., Menon-Sen, A., Melnikov, A., and N. Williams,
"Salted Challenge Response Authentication Mechanism
(SCRAM) SASL and GSS-API Mechanisms", <a href="./rfc5802">RFC 5802</a>,
July 2010.
Author's Address
Simon Josefsson
SJD AB
Hagagatan 24
Stockholm 113 47
SE
EMail: [email protected]
URI: <a href="http://josefsson.org/">http://josefsson.org/</a>
Josefsson Informational [Page 5]
Annotations
Select text to annotate