idnits 2.17.00 (12 Aug 2021) /tmp/idnits7592/draft-miller-jose-jwe-protected-jwk-00.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 seems to lack the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. (The document does seem to have the reference to RFC 2119 which the ID-Checklist requires). -- The document date (February 01, 2013) is 3395 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Outdated reference: draft-ietf-jose-json-web-algorithms has been published as RFC 7518 == Outdated reference: draft-ietf-jose-json-web-encryption has been published as RFC 7516 == Outdated reference: draft-ietf-jose-json-web-key has been published as RFC 7517 ** Obsolete normative reference: RFC 2898 (Obsoleted by RFC 8018) ** Downref: Normative reference to an Informational RFC: RFC 3394 ** Downref: Normative reference to an Informational RFC: RFC 4949 -- Duplicate reference: RFC2898, mentioned in 'RFC3447', was also mentioned in 'RFC2898'. -- Obsolete informational reference (is this intentional?): RFC 2898 (ref. 'RFC3447') (Obsoleted by RFC 8018) -- Obsolete informational reference (is this intentional?): RFC 5246 (Obsoleted by RFC 8446) Summary: 3 errors (**), 0 flaws (~~), 5 warnings (==), 4 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 JOSE Working Group M. Miller 3 Internet-Draft Cisco Systems, Inc. 4 Intended status: Standards Track February 01, 2013 5 Expires: August 05, 2013 7 Using JSON Web Encryption (JWE) for Protecting JSON Web Key (JWK) 8 Objects 9 draft-miller-jose-jwe-protected-jwk-00 11 Abstract 13 This document specifies an approach to protecting JSON Web Key (JWK) 14 objects using JSON Web Encryption (JWE). This document also 15 specifies a set of algorithms for encrypting content using password- 16 based cryptography. 18 Status of This Memo 20 This Internet-Draft is submitted in full conformance with the 21 provisions of BCP 78 and BCP 79. 23 Internet-Drafts are working documents of the Internet Engineering 24 Task Force (IETF). Note that other groups may also distribute 25 working documents as Internet-Drafts. The list of current Internet- 26 Drafts is at http://datatracker.ietf.org/drafts/current/. 28 Internet-Drafts are draft documents valid for a maximum of six months 29 and may be updated, replaced, or obsoleted by other documents at any 30 time. It is inappropriate to use Internet-Drafts as reference 31 material or to cite them other than as "work in progress." 33 This Internet-Draft will expire on August 05, 2013. 35 Copyright Notice 37 Copyright (c) 2013 IETF Trust and the persons identified as the 38 document authors. All rights reserved. 40 This document is subject to BCP 78 and the IETF Trust's Legal 41 Provisions Relating to IETF Documents 42 (http://trustee.ietf.org/license-info) in effect on the date of 43 publication of this document. Please review these documents 44 carefully, as they describe your rights and restrictions with respect 45 to this document. Code Components extracted from this document must 46 include Simplified BSD License text as described in Section 4.e of 47 the Trust Legal Provisions and are provided without warranty as 48 described in the Simplified BSD License. 50 Table of Contents 52 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 53 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 54 3. Protecting Keys . . . . . . . . . . . . . . . . . . . . . . . 3 55 3.1. Details for Private Keys . . . . . . . . . . . . . . . . 4 56 3.2. Details for Symmetric Keys . . . . . . . . . . . . . . . 4 57 4. Private Key Example . . . . . . . . . . . . . . . . . . . . . 4 58 5. Symmetric Key Example . . . . . . . . . . . . . . . . . . . . 7 59 6. Using Password-Based Cryptography . . . . . . . . . . . . . . 9 60 6.1. PBKDF2 Key Type . . . . . . . . . . . . . . . . . . . . . 9 61 6.1.1. 's' Parameter . . . . . . . . . . . . . . . . . . . . 9 62 6.1.2. 'c' Parameter . . . . . . . . . . . . . . . . . . . . 9 63 6.2. PBES2 Key Encryption Algorithms . . . . . . . . . . . . . 10 64 6.2.1. PBES2-HS256+A128KW . . . . . . . . . . . . . . . . . 10 65 6.2.2. PBES2-HS512+A256KW . . . . . . . . . . . . . . . . . 10 66 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 10 67 7.1. JSON Web Key Types Registration . . . . . . . . . . . . . 10 68 7.2. JSON Web Key Parameters Registration . . . . . . . . . . 10 69 7.3. JSON Web Encryption Algorithms . . . . . . . . . . . . . 11 70 8. Security Considerations . . . . . . . . . . . . . . . . . . . 11 71 8.1. Re-using Keying Material . . . . . . . . . . . . . . . . 12 72 8.2. Lifetime of Protected Keys . . . . . . . . . . . . . . . 12 73 8.3. Password Considerations . . . . . . . . . . . . . . . . . 12 74 9. Internationalization Considerations . . . . . . . . . . . . . 12 75 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 13 76 10.1. Normative References . . . . . . . . . . . . . . . . . . 13 77 10.2. Informative References . . . . . . . . . . . . . . . . . 14 78 Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 14 79 Appendix B. Document History . . . . . . . . . . . . . . . . . . 14 80 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 14 82 1. Introduction 84 There are times when it is necessary to transport or exchange a 85 private or symmetric key, but the transport mechanism might not 86 provide adequate content protection for the key. For instance, end- 87 to-end scenarios where the key holder and key recipient are linked 88 through multiple network hops that might or might not employ 89 transport layer security (TLS, [RFC5246]), nor might exchange of a 90 key using physical media such as a USB drive that itself is not 91 encrypted. 93 This document specifies an approach that uses [JWE] to encrypt a 94 private or symmetric key that is formatted as [JWK]. This document 95 also specifies and registers JSON Web Key formats and JSON Web 96 Encryption algorithms based on [RFC2898] that allow for protecting 97 keys using a password. 99 2. Terminology 101 This document inherits JSON Web Algorithms (JWA)-related terminology 102 from [JWA], JSON Web Encryption (JWE)-related terminology from [JWE], 103 JSON Web Key (JWK)-related terminology from [JWK], and password-based 104 cryptography-related terminology from [RFC2898]. Security-related 105 terms are to be understood in the sense defined in [RFC4949]. 107 The capitalized key words "MUST", "MUST NOT", "REQUIRED", "SHALL", 108 "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and 109 "OPTIONAL" in this document are to be interpreted as described in 110 [RFC2119]. 112 3. Protecting Keys 114 The process for protecting private keys and symmetric keys are 115 identical. The only differences are typically the algorithms used to 116 protect the key. 118 To protect a key, the key holder performs the following steps: 120 1. Converts the JWK object to a UTF-8 encoded string (K'). 122 2. Performs the message encryption steps from [JWE] to generate the 123 JWE header H, JWE Encrypted Key E, JWE Initialization Vector IV, 124 JWE Ciphertext C, and JWE Integrity Value I, using the following 125 inputs: 127 * The 'alg' property set to the intended key encryption 128 algorithm (e.g., "RSA-OAEP", or "PBES2-HS512+A256KW" from 129 below). 131 * Keying material appropriate for the selected key encryption 132 algorithm (e.g., private key for "RSA-OAEP", or shared 133 password, salt, and iteration count for "PBES2-HS512+A256KW"). 135 * The 'enc' property set to the intended content encryption 136 algorithm (e.g., "A256GCM" or "A256CBC+HS512"). 138 * Keying material appropriate for the selected content 139 encryption algorithm (e.g., Content Encryption Key and 140 Initialization Vector). 142 * K' as the plaintext content to encrypt. 144 3. Serializes to the appropriate format for exchange, such as the 145 Compact Serialization documented in [JWE]. 147 3.1. Details for Private Keys 149 Private keys are typically protected using a symmetric key. This 150 symmetric key can be exchanged or determined in various ways, such as 151 deriving one from a user-supplied password; the algorithms 152 "PBES2-HS256+A128KW" and "PBES2-HS512+A256KW" (defined in 153 Section 6.2) enable this. 155 3.2. Details for Symmetric Keys 157 Symmetric keys are typically protected using public-private key 158 pairs. It is assumed the key holder has the appropriate public 159 key(s) for the key recipient(s). 161 The process defined herein expects JWK objects. While more compact 162 to simply encrypt the symmetric key directly with a public key, using 163 the complete JWE process on complete JWK objects allows additional 164 properties to be protected (e.g., expected lifetime, acceptable uses) 165 without exceeding the input limits inherent in most public-private 166 key operations. 168 4. Private Key Example 170 NOTE: unless otherwise indicated, all line breaks are included for 171 readability. 173 The key holder begins with the [JWK] representation of the private 174 key (here using a [RFC3447] RSA private key, formatted per [JPSK]): 176 { 177 "kty":"RSA", 178 "kid":"juliet@capulet.lit", 179 "n":"ALekPD1kotXZCY_YUz_ITWBZb2nTOw35VvZlnqTiYSeusO58qCtYDz 180 ahTEkEcjtduRqfkxJKHYVq9Iro4x1cewXFdJZUuMOQAhoD63AHemXE 181 kdPiKqJvkBXDT_Eo4NPOjMKKkFPy2MsJQBmdtVknUvzxEchhYjZ490 182 EJTvGJ7OYwrSwkcCxy9D29XxL-OQLkSLlH1XD8kgVmJw8hsb42Bg0j 183 PgKlkvcyENmYpYE_hqlJoqYNFzgtAnNtK4C3tspix46R3IgilQG2Of 184 i99vpUnmTvjrOlNef2l65PRsPHD1Gl9fyPLCxrkolXbdwvxZ9j2d2f 185 Iu-OBTxRhnBtarNls_k", 186 "e":"AQAB", 187 "d":"GRtbIQmhOZtyszfgKdg4u_N-R_mZGU_9k7JQ_jn1DnfTuMdSNprTea 188 STyWfSNkuaAwnOEbIQVy1IQbWVV25NY3ybc_IhUJtfri7bAXYEReWa 189 Cl3hdlPKXy9UvqPYGR0kIXTQRqns-dVJ7jahlI7LyckrpTmrM8dWBo 190 4_PMaenNnPiQgO0xnuToxutRZJfJvG4Ox4ka3GORQd9CsCZ2vsUDms 191 XOfUENOyMqADC6p1M3h33tsurY15k9qMSpG9OX_IJAXmxzAh_tWiZO 192 wk2K4yxH9tS3Lq1yX8C1EWmeRDkK2ahecG85-oLKQt5VEpWHKmjOi_ 193 gJSdSgqcN96X52esAQ", 194 "p":"ANq50jleISkjfLEuAoHEBxW7NPF26BQ6irpt7HOIdxkca05kHZdWSv 195 bsPjyB30D9BZMV1a8flhPmRG66orx_9ogi1Eu8AJel7wEbdSpCGlMT 196 z0mAfcpN9bNEPFCvehN_zqwAwGLQCbPjNycQi3zYKoeehw5xE00IR9 197 6wk-U98icL", 198 "q":"2a43135aa05479f570676fc36e3d693d0ab21d21e38fdd0be71fcc 199 3b3a9800931c2cc66d6d4b702aabd50eaded6c4a3764872885b0ed 200 b7a49b7e65b382069ba50c4dc6e069a0e39ffdafc780c5cafe586a 201 8a0238cbf92a4b5c18e762308d49f9ae046b27ec98a35878d4a47e 202 bf3da9621100798ae1b6d5adc55a8b0915620fa7", 203 "dp":"KkMTWqBUefVwZ2_Dbj1pPQqyHSHjj90L5x_MOzqYAJMcLMZtbUtwK 204 qvVDq3tbEo3ZIcohbDtt6SbfmWzggabpQxNxuBpoOOf_a_HgMXK_l 205 hqigI4y_kqS1wY52IwjUn5rgRrJ-yYo1h41KR-vz2pYhEAeYrhttW 206 txVqLCRViD6c", 207 "dq":"AvfS0-gRxvn0bwJoMSnFxYcK1WnuEjQFluMGfwGitQBWtfZ1Er7t1 208 xDkbN9GQTB9yqpDoYaN06H7CFtrkxhJIBQaj6nkF5KKS3TQtQ5qCz 209 kOkmxIe3KRbBymXxkb5qwUpX5ELD5xFc6FeiafWYY63TmmEAu_lRF 210 COJ3xDea-ots", 211 "qi":"AJUkIvsPQqclEXjBKz9UbAS5O8DbTr7OREKT6prjL6luezQVHM0nB 212 KD8JlKqmm7vVdPj8uHUOe_22qaCkbtUfdG77hZ1Ot0h1hBYJWULyQ 213 zHgL5o-LJvhadKGLv53qLYENIc2yOYK8u2o3WMvftpTcf--mgWaDl 214 LvRwiflLH0jiP" 215 } 217 The key holder uses the following [JWE] inputs: 219 JWE Header: 221 { 222 "alg":"PBES2-HS256+A128KW", 223 "enc":"A128CBC+HS256", 224 "jwk":{ 225 "kty":"PBKDF2", 226 "s":"2WCTcJZ1Rvd_CJuJripQ1w", 227 "c":4096 228 } 229 } 231 Password: 233 Thus from my lips, by yours, my sin is purged. 235 Content Master Key (encoded as base64url per [RFC4686]): 237 1ICvnpc3zPRNS7JoJ9bnJ929eX7EnRwmc0CHNOF1zKc 239 Initialization Vector (encoded as base64url per [RFC4686]): 241 B9BVK3hIsEu9zUOWjKeOSg 243 The key holder performs steps 1 and 2 to generate the [JWE] outputs 244 (represented using the Compact Serialization): 246 eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1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zWv65o6MCzLVN4Wlf4tZ6a7FnLxDg0jQBsPGh3ZKEeGmvxJKSvGK_Or 281 5-gXJdMyj1n0bWyex-ZTmtbR3OHKgAlFQUdLuB-47UFS0HtF0Lo1ENPZUoxwFcg 282 Uu2Yr30O8vhHLhkRAyAvrFPBHhSqcGr954FeMhMo18dKu3zdykyueIQpLIpU7qN 283 btXXSOu1c1rPqBMm3h77iLmNzSByFER32-W7hQwx9-Ikbwy52DaZACpXdyzZOQ2 284 PSYEJeuy8CyHap8_Dwucb3CQiqBi-iz25Mmwx8qBjWq3K31W4WeF0heC_rCe6LS 285 vOCuHJXpu8Wqa1LeyTbuHyQawH8Aev-MzVLXp0E-WtggfNi-mqcThs25993uveI 286 TpmK6lyQu6SX31t6MlQKI_29e46cYRMFhsEZSGM--acnZiryvi39IKsVNtOf33E 287 9zlKntRdmMoROenR-q5--9nObKaF81k3Xb-yWNTlQh1ot59rWAeqpPv0uA. 288 big8BFT-dXJqoKGScpLk0ssjuyWn7fxDvJc7AN7ONPw 290 5. Symmetric Key Example 292 NOTE: unless otherwise indicated, all line breaks are included for 293 readability. 295 The key holder begins with the [JWK] representation of the symmetric 296 key (here using a [AES] 128-bit key, formatted as per [JPSK]): 298 { 299 "kty":"oct", 300 "kid": "b8acba65-8af2-4e93-a8e0-d4abd7f25e52", 301 "k": "fKrBr19_ne9Cp3akXGpqgA" 302 } 304 The key holder uses the following [JWE] inputs: 306 JWE Header: 308 { 309 "alg":"RSA-OAEP", 310 "enc":"A128CBC+HS256", 311 "jwk":{ 312 "kty":"RSA", 313 "n":"ALekPD1kotXZCY_YUz_ITWBZb2nTOw35VvZlnqTiYSeusO58qCtYDz 314 ahTEkEcjtduRqfkxJKHYVq9Iro4x1cewXFdJZUuMOQAhoD63AHemXE 315 kdPiKqJvkBXDT_Eo4NPOjMKKkFPy2MsJQBmdtVknUvzxEchhYjZ490 316 EJTvGJ7OYwrSwkcCxy9D29XxL-OQLkSLlH1XD8kgVmJw8hsb42Bg0j 317 PgKlkvcyENmYpYE_hqlJoqYNFzgtAnNtK4C3tspix46R3IgilQG2Of 318 i99vpUnmTvjrOlNef2l65PRsPHD1Gl9fyPLCxrkolXbdwvxZ9j2d2f 319 Iu-OBTxRhnBtarNls_k", 320 "e":"AQAB" 321 } 322 } 324 Content Master Key (encoded as base64url per [RFC4686]): 326 ci5IlLIHnFLn-1lhL5CWOS3DdbXGU-BPuFCrLspXAkA 328 Initialization Vector (encoded as base64url per [RFC4686]): 330 _dYbckd_xuJUBUNsxkT9yw 332 The key holder performs steps 1 and 2 to generate the [JWE] outputs 333 (represented using the Compact Serialization): 335 eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkExMjhDQkMrSFMyNTYiLCJqd2siOns 336 ia3R5IjoiUlNBIiwibiI6IkFMZWtQRDFrb3RYWkNZX1lVel9JVFdCWmIyblRPdz 337 M1VnZabG5xVGlZU2V1c081OHFDdFlEemFoVEVrRWNqdGR1UnFma3hKS0hZVnE5S 338 XJvNHgxY2V3WEZkSlpVdU1PUUFob0Q2M0FIZW1YRWtkUGlLcUp2a0JYRFRfRW80 339 TlBPak1LS2tGUHkyTXNKUUJtZHRWa25Vdnp4RWNoaFlqWjQ5MEVKVHZHSjdPWXd 340 yU3drY0N4eTlEMjlYeEwtT1FMa1NMbEgxWEQ4a2dWbUp3OGhzYjQyQmcwalBnS2 341 xrdmN5RU5tWXBZRV9ocWxKb3FZTkZ6Z3RBbk50SzRDM3RzcGl4NDZSM0lnaWxRR 342 zJPZmk5OXZwVW5tVHZqck9sTmVmMmw2NVBSc1BIRDFHbDlmeVBMQ3hya29sWGJk 343 d3Z4WjlqMmQyZkl1LU9CVHhSaG5CdGFyTmxzX2siLCJlIjoiQVFBQiJ9fQ. 344 UW26BTjbDGjgQ288JXJpGGpbZVV3WyZYJdm1Fvux8wM_t7bh6UbjbOdYXjL3rzD 345 phZteaD-DXiKrdGaVndTMLUmjg78H0R9K2WHxWNhTWiq8iMDGtw6BYnHW_r5DSf 346 vhoj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kdztEj_xLzSZjMxeO6o2hVJScLzzyG_Fy 364 T2v2kUHv_qeal18x-ICLR3yyF6JzoT0zKYPouBEIM5EZNAX9A3UjG0kNWW4Lou9 365 dlbLIZm-T7H6kj89RATMbDCwHa-nsF2kmnTRR6djt7lzDU1CHEEcM83ZWxi9qTR 366 cN_YrCokMkSjZYI87GqmnYHFsTktBBMNDX0u9SBdDZSwmz4EPsn7blYFt6Oiyd- 367 EBJlE_ocI4desERjIj0vKsgCoa9ea46S4m_gPa8xlCHK9wcsXU0ZhH8Lo_PyLm0 368 4CnjAbhKV0g8WvupjRQijkA6WoqYxQCP9EsDWH7kHJxDWV0uXXFoPZkcW5DBWrG 369 1NUC4TAjjI-9qhW7bpBZTLZHDJ99Awsh5lBqPYwUoPMS-lx-FPv9pAEih0rdHdH 370 __PelgmXKSwsoBSXzS_ErzePKwTfMAqedpe4WVykQ1rOTRn3uW01sv5gfRBRpo. 371 PnWwSPZ6TWOHKQwCIIt1HcCLhXof1j4frx2IcLXjIQ0 373 6. Using Password-Based Cryptography 375 There are often times when a key is exchanged through immediate human 376 interaction. To help facilitate such exchanges, a number of 377 password-based cryptography schemes utilizing [RFC2898] are defined 378 to supplement the key format and encryption algorithms from [JWA]. 380 6.1. PBKDF2 Key Type 382 The "PBKDF2" key type is used to contain the parameters necessary to 383 derive a cipher key from a password using the PBKDF2 algorithm from 384 [RFC2898]. The following parameters are defined: 386 6.1.1. 's' Parameter 388 The REQUIRED "s" parameter contains the PBKDF2 salt value (S), as a 389 base64url encoded string (per [RFC4686]). This value MUST NOT be the 390 empty string "". 392 6.1.2. 'c' Parameter 393 The REQUIRED "c" parameter contains the PBKDF2 iteration count (c), 394 as an integer. This value MUST NOT be less than 1, as per [RFC2898]. 396 6.2. PBES2 Key Encryption Algorithms 398 The "PBES2-HS256+A128KW" and "PBES2-HS512+A256KW" algorithms defined 399 below are used to encrypt a JWE Content Master Key using a user- 400 supplied password to derive the key encryption key. With these 401 algorithms, the derived key is used to encrypt the JWE Content Master 402 Key. These algorithms combine a key derivation function with an 403 encryption scheme to encrypt the JWE Content Master Key according to 404 PBES2 from section 6.2 of [RFC2898]. 406 6.2.1. PBES2-HS256+A128KW 408 The "PBES2-HS256+A128KW" algorithm uses "HMAC-SHA256" as the PRF and 409 "AES128-WRAP" as defined in [RFC3394] for the encryption scheme. The 410 salt (S) and iteration count (c) MUST be specified by the "s" and "c" 411 parameters (respectively) in the applicable "PBKDF2" JWK object. The 412 derived-key length (dkLen) is 16 octets. 414 6.2.2. PBES2-HS512+A256KW 416 The "PBES2-HS512+A256KW" algorithm uses "HMAC-SHA512" as the PRF "and 417 "AES256-WRAP" as defined in [RFC3394] for the encryption scheme. The 418 salt (S) and iteration count (c) MUST be specified by the "s" and "c" 419 parameters (respectively) in the applicable "PBKDF2" JWK object. The 420 derived-key length (dkLen) is 32 octets. 422 7. IANA Considerations 424 7.1. JSON Web Key Types Registration 426 o "kty" Paramater value: "PBKDF2" 428 o Implementation Requirements: OPTIONAL 430 o Change Controller: IETF 432 o Specification Document(s): Section 6.1 of [[ this document ]] 434 7.2. JSON Web Key Parameters Registration 436 o Parameter Name: "s" 437 o Change Controller: IETF 439 o Specification Document(s): Section 6.1.1 of [[ this document ]] 441 o Parameter Name: "c" 443 o Change Controller: IETF 445 o Specification Document(s): Section 6.1.2 of [[ this document ]] 447 7.3. JSON Web Encryption Algorithms 449 o Algorithm Name: "PBES2-HS256+A128KW" 451 o Algorithm Usage Location(s): "alg" 453 o Implementation Requirements: OPTIONAL 455 o Change Controller: IETF 457 o Specification Document(s): Section 6.2.1 of [[ this document ]] 459 o Algorithm Name: "PBES2-HS512+A256KW" 461 o Algorithm Usage Location(s): "alg" 463 o Implementation Requirements: OPTIONAL 465 o Change Controller: IETF 467 o Specification Document(s): Section 6.2.2 of [[ this document ]] 469 8. Security Considerations 470 8.1. Re-using Keying Material 472 It is NOT RECOMMENDED to re-use the same keying material (Key 473 Encryption Key, Content Master Key, Initialization Vector, etc) to 474 protect multiple JWK objects, or to protect the same JWK object 475 multiple times. When using "PBES2-HS256+A128KW" or 476 "PBES2-HS512+A256KW", implementations MUST NOT use the same Key 477 Encryption Key for a given password, and SHOULD take steps to prevent 478 the same Key Encryption Key being used by different passwords when 479 possible. 481 8.2. Lifetime of Protected Keys 483 Depending on the application, a protected JWK could potentially be 484 stored for an indefinite time, anywhere from milliseconds (e.g., 485 broadcasted over a computer network) to years (e.g., stored as a 486 file). 488 8.3. Password Considerations 490 While convenient for end users, passwords have many drawbacks. To 491 help mitigate these limitations, this document applies principles 492 from [RFC2898] to derive cryptographic keys from user-supplied 493 passwords. 495 The salt expands the possible keys that can be derived from a given 496 password. [RFC2898] originally recommended a minimum salt length of 497 8 octets (since there is no concern here of a derived key being re- 498 used for different purposes). The salt MUST be generated randomly; 499 see [RFC4086] for considerations on generating random values. 501 The iteration count adds computational expense, ideally compounded by 502 the possible range of keys introduced by the salt. [RFC2898] 503 originally recommended a minimum iteration count of 1000. 505 An ideal password is one that is as large (or larger) than the 506 derived key length but less than the PRF's block size. For 507 "PBES2-HS256+A128KW", the ideal password is between 16 and 64 octets 508 long; for "PBES2-HS512+A256KW", the ideal password is between 32 and 509 128 octets long. 511 9. Internationalization Considerations 512 Passwords obtained from users are likely to require preparation and 513 normalization to account for differences of octet sequences generated 514 by different input devices, locales, etc. It is RECOMMENDED for 515 applications to perform the steps outlined in [SASLPREP] to prepare a 516 user-supplied password before performing key derivation and 517 encryption. 519 10. References 521 10.1. Normative References 523 [JWA] Jones, M., "JSON Web Algorithms (JWA)", draft-ietf-jose- 524 json-web-algorithms-08 (work in progress), December 2012. 526 [JWE] Jones, M., Rescola, E., and J. Hildebrand, "JSON Web 527 Encryption (JWE)", draft-ietf-jose-json-web-encryption-08 528 (work in progress), December 2012. 530 [JWK] Jones, M., "JSON Web Key (JWK)", draft-ietf-jose-json-web- 531 key-08 (work in progress), December 2012. 533 [JPSK] Jones, M., "JSON Private and Symmetric Key", draft-jones- 534 jose-json-private-and-symmetric-key-00 (work in progress), 535 December 2012. 537 [SASLPREP] 538 Saint-Andre, P., "Preparation and Comparison of 539 Internationalized Strings Representing Simple User Names 540 and Passwords", draft-melnikov-precis-saslprepbis-04 (work 541 in progress), September 2012. 543 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 544 Requirement Levels", BCP 14, RFC 2119, March 1997. 546 [RFC2898] Kaliski, B., "Password-Based Cryptography Specification", 547 RFC 2898, September 2000. 549 [RFC3394] Schaad, J. and R. Housley, "Advanced Encryption Standard 550 (AES) Key Wrap Algorithm", RFC 3394, September 2002. 552 [RFC4086] Eastlake, D., Schiller, J., and S. Crocker, "Randomness 553 Requirements for Security", RFC 4086, June 2005. 555 [RFC4686] Josefsson, S., "The Base16, Base32, and Base64 Data 556 Encodings", RFC 4648, October 2006. 558 [RFC4949] Shirey, R., "Internet Security Glossary, Version 2", RFC 559 4949, August 2007. 561 10.2. Informative References 563 [AES] National Institute of Standards and Technology (NIST), 564 "Advanced Encryption Standard (AES)", FIPS PUB 197, 565 November 2001. 567 [RFC3447] Jonsson, J. and B. Kaliski, "Public-Key Cryptography 568 Standards (PKCS) #1: RSA Cryptography Specifications 569 Version 2.1", RFC 2898, February 2003. 571 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 572 (TLS) Protocol Version 1.2", RFC 5246, August 2008. 574 Appendix A. Acknowledgements 576 Appendix B. Document History 578 -00 Initial revision 580 Author's Address 582 Matthew Miller 583 Cisco Systems, Inc. 584 1899 Wynkoop Street, Suite 600 585 Denver, CO 80202 586 USA 588 Phone: +1-303-308-3204 589 Email: mamille2@cisco.com