1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901
|
<pre>Network Working Group B. Kaliski
Request for Comments: 2898 RSA Laboratories
Category: Informational September 2000
<span class="h1">PKCS #5: Password-Based Cryptography Specification</span>
<span class="h1">Version 2.0</span>
Status of this Memo
This memo provides information for the Internet community. It does
not specify an Internet standard of any kind. Distribution of this
memo is unlimited.
Copyright Notice
Copyright (C) The Internet Society (2000). All Rights Reserved.
Abstract
This memo represents a republication of PKCS #5 v2.0 from RSA
Laboratories' Public-Key Cryptography Standards (PKCS) series, and
change control is retained within the PKCS process. The body of this
document, except for the security considerations section, is taken
directly from that specification.
This document provides recommendations for the implementation of
password-based cryptography, covering key derivation functions,
encryption schemes, message-authentication schemes, and ASN.1 syntax
identifying the techniques.
The recommendations are intended for general application within
computer and communications systems, and as such include a fair
amount of flexibility. They are particularly intended for the
protection of sensitive information such as private keys, as in PKCS
#8 [<a href="#ref-25">25</a>]. It is expected that application standards and implementation
profiles based on these specifications may include additional
constraints.
Other cryptographic techniques based on passwords, such as password-
based key entity authentication and key establishment protocols
[<a href="#ref-4" title="pages 72-84">4</a>][5][<a href="#ref-26" title="Internet Society">26</a>] are outside the scope of this document. Guidelines for
the selection of passwords are also outside the scope.
<span class="grey">Kaliski Informational [Page 1]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-2" ></span>
<span class="grey"><a href="./rfc2898">RFC 2898</a> Password-Based Cryptography September 2000</span>
Table of Contents
<a href="#section-1">1</a>. Introduction ............................................... <a href="#page-3">3</a>
<a href="#section-2">2</a>. Notation ................................................... <a href="#page-3">3</a>
<a href="#section-3">3</a>. Overview ................................................... <a href="#page-4">4</a>
<a href="#section-4">4</a>. Salt and iteration count ................................... <a href="#page-6">6</a>
<a href="#section-4.1">4.1</a> Salt ................................................... <a href="#page-6">6</a>
<a href="#section-4.2">4.2</a> Iteration count ........................................ <a href="#page-8">8</a>
<a href="#section-5">5</a>. Key derivation functions ................................... <a href="#page-8">8</a>
<a href="#section-5.1">5.1</a> PBKDF1 ................................................. <a href="#page-9">9</a>
<a href="#section-5.2">5.2</a> PBKDF2 ................................................. <a href="#page-9">9</a>
<a href="#section-6">6</a>. Encryption schemes ......................................... <a href="#page-11">11</a>
<a href="#section-6.1">6.1</a> PBES1 .................................................. <a href="#page-12">12</a>
<a href="#section-6.1.1">6.1.1</a> Encryption operation ............................ <a href="#page-12">12</a>
<a href="#section-6.1.2">6.1.2</a> Decryption operation ............................ <a href="#page-13">13</a>
<a href="#section-6.2">6.2</a> PBES2 .................................................. <a href="#page-14">14</a>
<a href="#section-6.2.1">6.2.1</a> Encryption operation ............................ <a href="#page-14">14</a>
<a href="#section-6.2.2">6.2.2</a> Decryption operation ............................ <a href="#page-15">15</a>
<a href="#section-7">7</a>. Message authentication schemes ............................. <a href="#page-15">15</a>
<a href="#section-7.1">7.1</a> PBMAC1 ................................................. <a href="#page-16">16</a>
<a href="#section-7.1.1">7.1.1</a> MAC generation .................................. <a href="#page-16">16</a>
<a href="#section-7.1.2">7.1.2</a> MAC verification ................................ <a href="#page-16">16</a>
<a href="#section-8">8</a>. Security Considerations .................................... <a href="#page-17">17</a>
<a href="#section-9">9</a>. Author's Address............................................ <a href="#page-17">17</a>
<a href="#appendix-A">A</a>. ASN.1 syntax ............................................... <a href="#page-18">18</a>
<a href="#appendix-A.1">A.1</a> PBKDF1 ................................................. <a href="#page-18">18</a>
<a href="#appendix-A.2">A.2</a> PBKDF2 ................................................. <a href="#page-18">18</a>
<a href="#appendix-A.3">A.3</a> PBES1 .................................................. <a href="#page-20">20</a>
<a href="#appendix-A.4">A.4</a> PBES2 .................................................. <a href="#page-20">20</a>
<a href="#appendix-A.5">A.5</a> PBMAC1 ................................................. <a href="#page-21">21</a>
<a href="#appendix-B">B</a>. Supporting techniques ...................................... <a href="#page-22">22</a>
<a href="#appendix-B.1">B.1</a> Pseudorandom functions ................................. <a href="#page-22">22</a>
<a href="#appendix-B.2">B.2</a> Encryption schemes ..................................... <a href="#page-23">23</a>
<a href="#appendix-B.3">B.3</a> Message authentication schemes ......................... <a href="#page-26">26</a>
<a href="#appendix-C">C</a>. ASN.1 module ............................................... <a href="#page-26">26</a>
Intellectual Property Considerations ............................ <a href="#page-30">30</a>
Revision history ................................................ <a href="#page-30">30</a>
References ...................................................... <a href="#page-31">31</a>
Contact Information & About PKCS ................................ <a href="#page-33">33</a>
Full Copyright Statement ........................................ <a href="#page-34">34</a>
<span class="grey">Kaliski Informational [Page 2]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-3" ></span>
<span class="grey"><a href="./rfc2898">RFC 2898</a> Password-Based Cryptography September 2000</span>
<span class="h2"><a class="selflink" id="section-1" href="#section-1">1</a>. Introduction</span>
This document provides recommendations for the implementation of
password-based cryptography, covering the following aspects:
- key derivation functions
- encryption schemes
- message-authentication schemes
- ASN.1 syntax identifying the techniques
The recommendations are intended for general application within
computer and communications systems, and as such include a fair
amount of flexibility. They are particularly intended for the
protection of sensitive information such as private keys, as in PKCS
#8 [<a href="#ref-25">25</a>]. It is expected that application standards and implementation
profiles based on these specifications may include additional
constraints.
Other cryptographic techniques based on passwords, such as password-
based key entity authentication and key establishment protocols
[<a href="#ref-4" title="pages 72-84">4</a>][5][<a href="#ref-26" title="Internet Society">26</a>] are outside the scope of this document. Guidelines for
the selection of passwords are also outside the scope.
This document supersedes PKCS #5 version 1.5 [<a href="#ref-24">24</a>], but includes
compatible techniques.
<span class="h2"><a class="selflink" id="section-2" href="#section-2">2</a>. Notation</span>
C ciphertext, an octet string
c iteration count, a positive integer
DK derived key, an octet string
dkLen length in octets of derived key, a positive integer
EM encoded message, an octet string
Hash underlying hash function
hLen length in octets of pseudorandom function output, a positive
integer
l length in blocks of derived key, a positive integer
IV initialization vector, an octet string
K encryption key, an octet string
<span class="grey">Kaliski Informational [Page 3]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-4" ></span>
<span class="grey"><a href="./rfc2898">RFC 2898</a> Password-Based Cryptography September 2000</span>
KDF key derivation function
M message, an octet string
P password, an octet string
PRF underlying pseudorandom function
PS padding string, an octet string
psLen length in octets of padding string, a positive integer
S salt, an octet string
T message authentication code, an octet string
T_1, ..., T_l, U_1, ..., U_c
intermediate values, octet strings
01, 02, ..., 08
octets with value 1, 2, ..., 8
\xor bit-wise exclusive-or of two octet strings
|| || octet length operator
|| concatenation operator
<i..j> substring extraction operator: extracts octets i through j,
0 <= i <= j
<span class="h2"><a class="selflink" id="section-3" href="#section-3">3</a>. Overview</span>
In many applications of public-key cryptography, user security is
ultimately dependent on one or more secret text values or passwords.
Since a password is not directly applicable as a key to any
conventional cryptosystem, however, some processing of the password
is required to perform cryptographic operations with it. Moreover, as
passwords are often chosen from a relatively small space, special
care is required in that processing to defend against search attacks.
A general approach to password-based cryptography, as described by
Morris and Thompson [<a href="#ref-8" title="22(11):594-597">8</a>] for the protection of password tables, is to
combine a password with a salt to produce a key. The salt can be
viewed as an index into a large set of keys derived from the
password, and need not be kept secret. Although it may be possible
for an opponent to construct a table of possible passwords (a so-
called "dictionary attack"), constructing a table of possible keys
<span class="grey">Kaliski Informational [Page 4]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-5" ></span>
<span class="grey"><a href="./rfc2898">RFC 2898</a> Password-Based Cryptography September 2000</span>
will be difficult, since there will be many possible keys for each
password. An opponent will thus be limited to searching through
passwords separately for each salt.
Another approach to password-based cryptography is to construct key
derivation techniques that are relatively expensive, thereby
increasing the cost of exhaustive search. One way to do this is to
include an iteration count in the key derivation technique,
indicating how many times to iterate some underlying function by
which keys are derived. A modest number of iterations, say 1000, is
not likely to be a burden for legitimate parties when computing a
key, but will be a significant burden for opponents.
Salt and iteration count formed the basis for password-based
encryption in PKCS #5 v1.5, and adopted here as well for the various
cryptographic operations. Thus, password-based key derivation as
defined here is a function of a password, a salt, and an iteration
count, where the latter two quantities need not be kept secret.
From a password-based key derivation function, it is straightforward
to define password-based encryption and message authentication
schemes. As in PKCS #5 v1.5, the password-based encryption schemes
here are based on an underlying, conventional encryption scheme,
where the key for the conventional scheme is derived from the
password. Similarly, the password-based message authentication scheme
is based on an underlying conventional scheme. This two-layered
approach makes the password-based techniques modular in terms of the
underlying techniques they can be based on.
It is expected that the password-based key derivation functions may
find other applications than just the encryption and message
authentication schemes defined here. For instance, one might derive a
set of keys with a single application of a key derivation function,
rather than derive each key with a separate application of the
function. The keys in the set would be obtained as substrings of the
output of the key derivation function. This approach might be
employed as part of key establishment in a session-oriented protocol.
Another application is password checking, where the output of the key
derivation function is stored (along with the salt and iteration
count) for the purposes of subsequent verification of a password.
Throughout this document, a password is considered to be an octet
string of arbitrary length whose interpretation as a text string is
unspecified. In the interest of interoperability, however, it is
recommended that applications follow some common text encoding rules.
ASCII and UTF-8 [<a href="#ref-27" title=""UTF-8, a transformation format of ISO 10646"">27</a>] are two possibilities. (ASCII is a subset of
UTF-8.)
<span class="grey">Kaliski Informational [Page 5]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-6" ></span>
<span class="grey"><a href="./rfc2898">RFC 2898</a> Password-Based Cryptography September 2000</span>
Although the selection of passwords is outside the scope of this
document, guidelines have been published [<a href="#ref-17">17</a>] that may well be taken
into account.
<span class="h2"><a class="selflink" id="section-4" href="#section-4">4</a>. Salt and Iteration Count</span>
Inasmuch as salt and iteration count are central to the techniques
defined in this document, some further discussion is warranted.
<span class="h3"><a class="selflink" id="section-4.1" href="#section-4.1">4.1</a> Salt</span>
A salt in password-based cryptography has traditionally served the
purpose of producing a large set of keys corresponding to a given
password, among which one is selected at random according to the
salt. An individual key in the set is selected by applying a key
derivation function KDF, as
DK = KDF (P, S)
where DK is the derived key, P is the password, and S is the salt.
This has two benefits:
1. It is difficult for an opponent to precompute all the keys
corresponding to a dictionary of passwords, or even the most
likely keys. If the salt is 64 bits long, for instance, there
will be as many as 2^64 keys for each password. An opponent is
thus limited to searching for passwords after a password-based
operation has been performed and the salt is known.
2. It is unlikely that the same key will be selected twice.
Again, if the salt is 64 bits long, the chance of "collision"
between keys does not become significant until about 2^32 keys
have been produced, according to the Birthday Paradox. This
addresses some of the concerns about interactions between
multiple uses of the same key, which may apply for some
encryption and authentication techniques.
In password-based encryption, the party encrypting a message can gain
assurance that these benefits are realized simply by selecting a
large and sufficiently random salt when deriving an encryption key
from a password. A party generating a message authentication code can
gain such assurance in a similar fashion.
The party decrypting a message or verifying a message authentication
code, however, cannot be sure that a salt supplied by another party
has actually been generated at random. It is possible, for instance,
that the salt may have been copied from another password-based
operation, in an attempt to exploit interactions between multiple
<span class="grey">Kaliski Informational [Page 6]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-7" ></span>
<span class="grey"><a href="./rfc2898">RFC 2898</a> Password-Based Cryptography September 2000</span>
uses of the same key. For instance, suppose two legitimate parties
exchange a encrypted message, where the encryption key is an 80-bit
key derived from a shared password with some salt. An opponent could
take the salt from that encryption and provide it to one of the
parties as though it were for a 40-bit key. If the party reveals the
result of decryption with the 40-bit key, the opponent may be able to
solve for the 40-bit key. In the case that 40-bit key is the first
half of the 80-bit key, the opponent can then readily solve for the
remaining 40 bits of the 80-bit key.
To defend against such attacks, either the interaction between
multiple uses of the same key should be carefully analyzed, or the
salt should contain data that explicitly distinguishes between
different operations. For instance, the salt might have an
additional, non-random octet that specifies whether the derived key
is for encryption, for message authentication, or for some other
operation.
Based on this, the following is recommended for salt selection:
1. If there is no concern about interactions between multiple uses
of the same key (or a prefix of that key) with the password-
based encryption and authentication techniques supported for a
given password, then the salt may be generated at random and
need not be checked for a particular format by the party
receiving the salt. It should be at least eight octets (64
bits) long.
2. Otherwise, the salt should contain data that explicitly
distinguishes between different operations and different key
lengths, in addition to a random part that is at least eight
octets long, and this data should be checked or regenerated by
the party receiving the salt. For instance, the salt could have
an additional non-random octet that specifies the purpose of
the derived key. Alternatively, it could be the encoding of a
structure that specifies detailed information about the derived
key, such as the encryption or authentication technique and a
sequence number among the different keys derived from the
password. The particular format of the additional data is left
to the application.
Note. If a random number generator or pseudorandom generator is not
available, a deterministic alternative for generating the salt (or
the random part of it) is to apply a password-based key derivation
function to the password and the message M to be processed. For
instance, the salt could be computed with a key derivation function
as S = KDF (P, M). This approach is not recommended if the message M
<span class="grey">Kaliski Informational [Page 7]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-8" ></span>
<span class="grey"><a href="./rfc2898">RFC 2898</a> Password-Based Cryptography September 2000</span>
is known to belong to a small message space (e.g., "Yes" or "No"),
however, since then there will only be a small number of possible
salts.
<span class="h3"><a class="selflink" id="section-4.2" href="#section-4.2">4.2</a> Iteration Count</span>
An iteration count has traditionally served the purpose of increasing
the cost of producing keys from a password, thereby also increasing
the difficulty of attack. For the methods in this document, a minimum
of 1000 iterations is recommended. This will increase the cost of
exhaustive search for passwords significantly, without a noticeable
impact in the cost of deriving individual keys.
<span class="h2"><a class="selflink" id="section-5" href="#section-5">5</a>. Key Derivation Functions</span>
A key derivation function produces a derived key from a base key and
other parameters. In a password-based key derivation function, the
base key is a password and the other parameters are a salt value and
an iteration count, as outlined in <a href="#section-3">Section 3</a>.
The primary application of the password-based key derivation
functions defined here is in the encryption schemes in <a href="#section-6">Section 6</a> and
the message authentication scheme in <a href="#section-7">Section 7</a>. Other applications
are certainly possible, hence the independent definition of these
functions.
Two functions are specified in this section: PBKDF1 and PBKDF2.
PBKDF2 is recommended for new applications; PBKDF1 is included only
for compatibility with existing applications, and is not recommended
for new applications.
A typical application of the key derivation functions defined here
might include the following steps:
1. Select a salt S and an iteration count c, as outlined in
<a href="#section-4">Section 4</a>.
2. Select a length in octets for the derived key, dkLen.
3. Apply the key derivation function to the password, the salt,
the iteration count and the key length to produce a derived
key.
4. Output the derived key.
Any number of keys may be derived from a password by varying the
salt, as described in <a href="#section-3">Section 3</a>.
<span class="grey">Kaliski Informational [Page 8]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-9" ></span>
<span class="grey"><a href="./rfc2898">RFC 2898</a> Password-Based Cryptography September 2000</span>
<span class="h3"><a class="selflink" id="section-5.1" href="#section-5.1">5.1</a> PBKDF1</span>
PBKDF1 applies a hash function, which shall be MD2 [<a href="#ref-6" title=""The MD2 Message-Digest Algorithm"">6</a>], MD5 [<a href="#ref-19" title=""The MD5 Message-Digest Algorithm"">19</a>] or
SHA-1 [<a href="#ref-18">18</a>], to derive keys. The length of the derived key is bounded
by the length of the hash function output, which is 16 octets for MD2
and MD5 and 20 octets for SHA-1. PBKDF1 is compatible with the key
derivation process in PKCS #5 v1.5.
PBKDF1 is recommended only for compatibility with existing
applications since the keys it produces may not be large enough for
some applications.
PBKDF1 (P, S, c, dkLen)
Options: Hash underlying hash function
Input: P password, an octet string
S salt, an eight-octet string
c iteration count, a positive integer
dkLen intended length in octets of derived key,
a positive integer, at most 16 for MD2 or
MD5 and 20 for SHA-1
Output: DK derived key, a dkLen-octet string
Steps:
1. If dkLen > 16 for MD2 and MD5, or dkLen > 20 for SHA-1, output
"derived key too long" and stop.
2. Apply the underlying hash function Hash for c iterations to the
concatenation of the password P and the salt S, then extract
the first dkLen octets to produce a derived key DK:
T_1 = Hash (P || S) ,
T_2 = Hash (T_1) ,
...
T_c = Hash (T_{c-1}) ,
DK = Tc<0..dkLen-1>
3. Output the derived key DK.
<span class="h3"><a class="selflink" id="section-5.2" href="#section-5.2">5.2</a> PBKDF2</span>
PBKDF2 applies a pseudorandom function (see <a href="#appendix-B.1">Appendix B.1</a> for an
example) to derive keys. The length of the derived key is essentially
unbounded. (However, the maximum effective search space for the
<span class="grey">Kaliski Informational [Page 9]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-10" ></span>
<span class="grey"><a href="./rfc2898">RFC 2898</a> Password-Based Cryptography September 2000</span>
derived key may be limited by the structure of the underlying
pseudorandom function. See <a href="#appendix-B.1">Appendix B.1</a> for further discussion.)
PBKDF2 is recommended for new applications.
PBKDF2 (P, S, c, dkLen)
Options: PRF underlying pseudorandom function (hLen
denotes the length in octets of the
pseudorandom function output)
Input: P password, an octet string
S salt, an octet string
c iteration count, a positive integer
dkLen intended length in octets of the derived
key, a positive integer, at most
(2^32 - 1) * hLen
Output: DK derived key, a dkLen-octet string
Steps:
1. If dkLen > (2^32 - 1) * hLen, output "derived key too long" and
stop.
2. Let l be the number of hLen-octet blocks in the derived key,
rounding up, and let r be the number of octets in the last
block:
l = CEIL (dkLen / hLen) ,
r = dkLen - (l - 1) * hLen .
Here, CEIL (x) is the "ceiling" function, i.e. the smallest
integer greater than, or equal to, x.
3. For each block of the derived key apply the function F defined
below to the password P, the salt S, the iteration count c, and
the block index to compute the block:
T_1 = F (P, S, c, 1) ,
T_2 = F (P, S, c, 2) ,
...
T_l = F (P, S, c, l) ,
where the function F is defined as the exclusive-or sum of the
first c iterates of the underlying pseudorandom function PRF
applied to the password P and the concatenation of the salt S
and the block index i:
<span class="grey">Kaliski Informational [Page 10]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-11" ></span>
<span class="grey"><a href="./rfc2898">RFC 2898</a> Password-Based Cryptography September 2000</span>
F (P, S, c, i) = U_1 \xor U_2 \xor ... \xor U_c
where
U_1 = PRF (P, S || INT (i)) ,
U_2 = PRF (P, U_1) ,
...
U_c = PRF (P, U_{c-1}) .
Here, INT (i) is a four-octet encoding of the integer i, most
significant octet first.
4. Concatenate the blocks and extract the first dkLen octets to
produce a derived key DK:
DK = T_1 || T_2 || ... || T_l<0..r-1>
5. Output the derived key DK.
Note. The construction of the function F follows a "belt-and-
suspenders" approach. The iterates U_i are computed recursively to
remove a degree of parallelism from an opponent; they are exclusive-
ored together to reduce concerns about the recursion degenerating
into a small set of values.
<span class="h2"><a class="selflink" id="section-6" href="#section-6">6</a>. Encryption Schemes</span>
An encryption scheme, in the symmetric setting, consists of an
encryption operation and a decryption operation, where the encryption
operation produces a ciphertext from a message under a key, and the
decryption operation recovers the message from the ciphertext under
the same key. In a password-based encryption scheme, the key is a
password.
A typical application of a password-based encryption scheme is a
private-key protection method, where the message contains private-key
information, as in PKCS #8. The encryption schemes defined here would
be suitable encryption algorithms in that context.
Two schemes are specified in this section: PBES1 and PBES2. PBES2 is
recommended for new applications; PBES1 is included only for
compatibility with existing applications, and is not recommended for
new applications.
<span class="grey">Kaliski Informational [Page 11]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-12" ></span>
<span class="grey"><a href="./rfc2898">RFC 2898</a> Password-Based Cryptography September 2000</span>
<span class="h3"><a class="selflink" id="section-6.1" href="#section-6.1">6.1</a> PBES1</span>
PBES1 combines the PBKDF1 function (<a href="#section-5.1">Section 5.1</a>) with an underlying
block cipher, which shall be either DES [<a href="#ref-15">15</a>] or RC2(tm) [<a href="#ref-21" title=""A Description of the RC2(r) Encryption Algorithm"">21</a>] in CBC
mode [<a href="#ref-16">16</a>]. PBES1 is compatible with the encryption scheme in PKCS #5
v1.5.
PBES1 is recommended only for compatibility with existing
applications, since it supports only two underlying encryption
schemes, each of which has a key size (56 or 64 bits) that may not be
large enough for some applications.
<span class="h4"><a class="selflink" id="section-6.1.1" href="#section-6.1.1">6.1.1</a> Encryption Operation</span>
The encryption operation for PBES1 consists of the following steps,
which encrypt a message M under a password P to produce a ciphertext
C:
1. Select an eight-octet salt S and an iteration count c, as
outlined in <a href="#section-4">Section 4</a>.
2. Apply the PBKDF1 key derivation function (<a href="#section-5.1">Section 5.1</a>) to the
password P, the salt S, and the iteration count c to produce at
derived key DK of length 16 octets:
DK = PBKDF1 (P, S, c, 16) .
3. Separate the derived key DK into an encryption key K consisting
of the first eight octets of DK and an initialization vector IV
consisting of the next eight octets:
K = DK<0..7> ,
IV = DK<8..15> .
4. Concatenate M and a padding string PS to form an encoded
message EM:
EM = M || PS ,
where the padding string PS consists of 8-(||M|| mod 8) octets
each with value 8-(||M|| mod 8). The padding string PS will
satisfy one of the following statements:
PS = 01, if ||M|| mod 8 = 7 ;
PS = 02 02, if ||M|| mod 8 = 6 ;
...
PS = 08 08 08 08 08 08 08 08, if ||M|| mod 8 = 0.
<span class="grey">Kaliski Informational [Page 12]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-13" ></span>
<span class="grey"><a href="./rfc2898">RFC 2898</a> Password-Based Cryptography September 2000</span>
The length in octets of the encoded message will be a multiple
of eight and it will be possible to recover the message M
unambiguously from the encoded message. (This padding rule is
taken from <a href="./rfc1423">RFC 1423</a> [<a href="#ref-3" title=""Privacy Enhancement for Internet Electronic Mail: Part III: Algorithms, Modes, and Identifiers"">3</a>].)
5. Encrypt the encoded message EM with the underlying block cipher
(DES or RC2) in cipher block chaining mode under the encryption
key K with initialization vector IV to produce the ciphertext
C. For DES, the key K shall be considered as a 64-bit encoding
of a 56-bit DES key with parity bits ignored (see [<a href="#ref-9">9</a>]). For
RC2, the "effective key bits" shall be 64 bits.
6. Output the ciphertext C.
The salt S and the iteration count c may be conveyed to the party
performing decryption in an AlgorithmIdentifier value (see <a href="#appendix-A.3">Appendix</a>
<a href="#appendix-A.3">A.3</a>).
<span class="h4"><a class="selflink" id="section-6.1.2" href="#section-6.1.2">6.1.2</a> Decryption Operation</span>
The decryption operation for PBES1 consists of the following steps,
which decrypt a ciphertext C under a password P to recover a message
M:
1. Obtain the eight-octet salt S and the iteration count c.
2. Apply the PBKDF1 key derivation function (<a href="#section-5.1">Section 5.1</a>) to the
password P, the salt S, and the iteration count c to produce a
derived key DK of length 16 octets:
DK = PBKDF1 (P, S, c, 16)
3. Separate the derived key DK into an encryption key K consisting
of the first eight octets of DK and an initialization vector IV
consisting of the next eight octets:
K = DK<0..7> ,
IV = DK<8..15> .
4. Decrypt the ciphertext C with the underlying block cipher (DES
or RC2) in cipher block chaining mode under the encryption key
K with initialization vector IV to recover an encoded message
EM. If the length in octets of the ciphertext C is not a
multiple of eight, output "decryption error" and stop.
5. Separate the encoded message EM into a message M and a padding
string PS:
<span class="grey">Kaliski Informational [Page 13]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-14" ></span>
<span class="grey"><a href="./rfc2898">RFC 2898</a> Password-Based Cryptography September 2000</span>
EM = M || PS ,
where the padding string PS consists of some number psLen
octets each with value psLen, where psLen is between 1 and 8.
If it is not possible to separate the encoded message EM in
this manner, output "decryption error" and stop.
6. Output the recovered message M.
<span class="h3"><a class="selflink" id="section-6.2" href="#section-6.2">6.2</a> PBES2</span>
PBES2 combines a password-based key derivation function, which shall
be PBKDF2 (<a href="#section-5.2">Section 5.2</a>) for this version of PKCS #5, with an
underlying encryption scheme (see <a href="#appendix-B.2">Appendix B.2</a> for examples). The key
length and any other parameters for the underlying encryption scheme
depend on the scheme.
PBES2 is recommended for new applications.
<span class="h4"><a class="selflink" id="section-6.2.1" href="#section-6.2.1">6.2.1</a> Encryption Operation</span>
The encryption operation for PBES2 consists of the following steps,
which encrypt a message M under a password P to produce a ciphertext
C, applying a selected key derivation function KDF and a selected
underlying encryption scheme:
1. Select a salt S and an iteration count c, as outlined in
<a href="#section-4">Section 4</a>.
2. Select the length in octets, dkLen, for the derived key for the
underlying encryption scheme.
3. Apply the selected key derivation function to the password P,
the salt S, and the iteration count c to produce a derived key
DK of length dkLen octets:
DK = KDF (P, S, c, dkLen) .
4. Encrypt the message M with the underlying encryption scheme
under the derived key DK to produce a ciphertext C. (This step
may involve selection of parameters such as an initialization
vector and padding, depending on the underlying scheme.)
5. Output the ciphertext C.
<span class="grey">Kaliski Informational [Page 14]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-15" ></span>
<span class="grey"><a href="./rfc2898">RFC 2898</a> Password-Based Cryptography September 2000</span>
The salt S, the iteration count c, the key length dkLen, and
identifiers for the key derivation function and the underlying
encryption scheme may be conveyed to the party performing decryption
in an AlgorithmIdentifier value (see <a href="#appendix-A.4">Appendix A.4</a>).
<span class="h4"><a class="selflink" id="section-6.2.2" href="#section-6.2.2">6.2.2</a> Decryption Operation</span>
The decryption operation for PBES2 consists of the following steps,
which decrypt a ciphertext C under a password P to recover a message
M:
1. Obtain the salt S for the operation.
2. Obtain the iteration count c for the key derivation function.
3. Obtain the key length in octets, dkLen, for the derived key for
the underlying encryption scheme.
4. Apply the selected key derivation function to the password P,
the salt S, and the iteration count c to produce a derived key
DK of length dkLen octets:
DK = KDF (P, S, c, dkLen) .
5. Decrypt the ciphertext C with the underlying encryption scheme
under the derived key DK to recover a message M. If the
decryption function outputs "decryption error," then output
"decryption error" and stop.
6. Output the recovered message M.
<span class="h2"><a class="selflink" id="section-7" href="#section-7">7</a>. Message Authentication Schemes</span>
A message authentication scheme consists of a MAC (message
authentication code) generation operation and a MAC verification
operation, where the MAC generation operation produces a message
authentication code from a message under a key, and the MAC
verification operation verifies the message authentication code under
the same key. In a password-based message authentication scheme, the
key is a password.
One scheme is specified in this section: PBMAC1.
<span class="grey">Kaliski Informational [Page 15]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-16" ></span>
<span class="grey"><a href="./rfc2898">RFC 2898</a> Password-Based Cryptography September 2000</span>
<span class="h3"><a class="selflink" id="section-7.1" href="#section-7.1">7.1</a> PBMAC1</span>
PBMAC1 combines a password-based key derivation function, which shall
be PBKDF2 (<a href="#section-5.2">Section 5.2</a>) for this version of PKCS #5, with an
underlying message authentication scheme (see <a href="#appendix-B.3">Appendix B.3</a> for an
example). The key length and any other parameters for the underlying
message authentication scheme depend on the scheme.
<span class="h4"><a class="selflink" id="section-7.1.1" href="#section-7.1.1">7.1.1</a> MAC Generation</span>
The MAC generation operation for PBMAC1 consists of the following
steps, which process a message M under a password P to generate a
message authentication code T, applying a selected key derivation
function KDF and a selected underlying message authentication scheme:
1. Select a salt S and an iteration count c, as outlined in
<a href="#section-4">Section 4</a>.
2. Select a key length in octets, dkLen, for the derived key for
the underlying message authentication function.
3. Apply the selected key derivation function to the password P,
the salt S, and the iteration count c to produce a derived key
DK of length dkLen octets:
DK = KDF (P, S, c, dkLen) .
4. Process the message M with the underlying message
authentication scheme under the derived key DK to generate a
message authentication code T.
5. Output the message authentication code T.
The salt S, the iteration count c, the key length dkLen, and
identifiers for the key derivation function and underlying message
authentication scheme may be conveyed to the party performing
verification in an AlgorithmIdentifier value (see <a href="#appendix-A.5">Appendix A.5</a>).
<span class="h4"><a class="selflink" id="section-7.1.2" href="#section-7.1.2">7.1.2</a> MAC Verification</span>
The MAC verification operation for PBMAC1 consists of the following
steps, which process a message M under a password P to verify a
message authentication code T:
1. Obtain the salt S and the iteration count c.
2. Obtain the key length in octets, dkLen, for the derived key for
the underlying message authentication scheme.
<span class="grey">Kaliski Informational [Page 16]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-17" ></span>
<span class="grey"><a href="./rfc2898">RFC 2898</a> Password-Based Cryptography September 2000</span>
3. Apply the selected key derivation function to the password P,
the salt S, and the iteration count c to produce a derived key
DK of length dkLen octets:
DK = KDF (P, S, c, dkLen) .
4. Process the message M with the underlying message
authentication scheme under the derived key DK to verify the
message authentication code T.
5. If the message authentication code verifies, output "correct";
else output "incorrect."
<span class="h2"><a class="selflink" id="section-8" href="#section-8">8</a>. Security Considerations</span>
Password-based cryptography is generally limited in the security that
it can provide, particularly for methods such as those defined in
this document where off-line password search is possible. While the
use of salt and iteration count can increase the complexity of attack
(see <a href="#section-4">Section 4</a> for recommendations), it is essential that passwords
are selected well, and relevant guidelines (e.g., [<a href="#ref-17">17</a>]) should be
taken into account. It is also important that passwords be protected
well if stored.
In general, different keys should be derived from a password for
different uses to minimize the possibility of unintended
interactions. For password-based encryption with a single algorithm,
a random salt is sufficient to ensure that different keys will be
produced. In certain other situations, as outlined in <a href="#section-4">Section 4</a>, a
structured salt is necessary. The recommendations in <a href="#section-4">Section 4</a> should
thus be taken into account when selecting the salt value.
<span class="h2"><a class="selflink" id="section-9" href="#section-9">9</a>. Author's Address</span>
Burt Kaliski
RSA Laboratories
20 Crosby Drive
Bedford, MA 01730 USA
EMail: bkaliski@rsasecurity.com
<span class="grey">Kaliski Informational [Page 17]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-18" ></span>
<span class="grey"><a href="./rfc2898">RFC 2898</a> Password-Based Cryptography September 2000</span>
APPENDICES
<span class="h2"><a class="selflink" id="appendix-A" href="#appendix-A">A</a>. ASN.1 Syntax</span>
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 [<a href="#ref-9">9</a>][10][<a href="#ref-11">11</a>][12][<a href="#ref-13">13</a>][14].)
The object identifier pkcs-5 identifies the arc of the OID tree from
which the PKCS #5-specific OIDs 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}
<span class="h3"><a class="selflink" id="appendix-A.1" href="#appendix-A.1">A.1</a> PBKDF1</span>
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.
<span class="h3"><a class="selflink" id="appendix-A.2" href="#appendix-A.2">A.2</a> PBKDF2</span>
The object identifier id-PBKDF2 identifies the PBKDF2 key derivation
function (<a href="#section-5.2">Section 5.2</a>).
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 }
The fields of type PKDF2-params have the following meanings:
<span class="grey">Kaliski Informational [Page 18]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-19" ></span>
<span class="grey"><a href="./rfc2898">RFC 2898</a> Password-Based Cryptography September 2000</span>
- 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 <a href="#section-4.1">Section 4.1</a>. 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 <a href="#section-4.1">Section 4.1</a> 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
<a href="#section-4.1">Section 4.1</a>), 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 <a href="#appendix-B.1.1">Appendix</a>
<a href="#appendix-B.1.1">B.1.1</a>) and any other OIDs defined by the application.
PBKDF2-PRFs ALGORITHM-IDENTIFIER ::=
{ {NULL IDENTIFIED BY id-hmacWithSHA1}, ... }
The default pseudorandom function is HMAC-SHA-1:
algid-hmacWithSHA1 AlgorithmIdentifier {{PBKDF2-PRFs}} ::=
{algorithm id-hmacWithSHA1, parameters NULL : NULL}
<span class="grey">Kaliski Informational [Page 19]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-20" ></span>
<span class="grey"><a href="./rfc2898">RFC 2898</a> Password-Based Cryptography September 2000</span>
<span class="h3"><a class="selflink" id="appendix-A.3" href="#appendix-A.3">A.3</a> PBES1</span>
Different object identifiers identify the PBES1 encryption scheme
(<a href="#section-6.1">Section 6.1</a>) 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 }
The fields of type PBEParameter have the following meanings:
- salt specifies the salt value, an eight-octet string.
- iterationCount specifies the iteration count.
<span class="h3"><a class="selflink" id="appendix-A.4" href="#appendix-A.4">A.4</a> PBES2</span>
The object identifier id-PBES2 identifies the PBES2 encryption scheme
(<a href="#section-6.2">Section 6.2</a>).
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}} }
<span class="grey">Kaliski Informational [Page 20]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-21" ></span>
<span class="grey"><a href="./rfc2898">RFC 2898</a> Password-Based Cryptography September 2000</span>
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. Example underlying
encryption schemes are given in <a href="#appendix-B.2">Appendix B.2</a>.
PBES2-Encs ALGORITHM-IDENTIFIER ::= { ... }
<span class="h3"><a class="selflink" id="appendix-A.5" href="#appendix-A.5">A.5</a> PBMAC1</span>
The object identifier id-PBMAC1 identifies the PBMAC1 message
authentication scheme (<a href="#section-7.1">Section 7.1</a>).
id-PBMAC1 OBJECT IDENTIFIER ::= {pkcs-5 14}
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. Example
underlying encryption schemes are given in <a href="#appendix-B.3">Appendix B.3</a>.
PBMAC1-MACs ALGORITHM-IDENTIFIER ::= { ... }
<span class="grey">Kaliski Informational [Page 21]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-22" ></span>
<span class="grey"><a href="./rfc2898">RFC 2898</a> Password-Based Cryptography September 2000</span>
<span class="h2"><a class="selflink" id="appendix-B" href="#appendix-B">B</a>. Supporting Techniques</span>
This section gives several examples of underlying functions and
schemes supporting the password-based schemes in Sections <a href="#section-5">5</a>, <a href="#section-6">6</a> and <a href="#section-7">7</a>.
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}
<span class="h3"><a class="selflink" id="appendix-B.1" href="#appendix-B.1">B.1</a> Pseudorandom functions</span>
An example pseudorandom function for PBKDF2 (<a href="#section-5.2">Section 5.2</a>) is HMAC-
SHA-1.
<span class="h4"><a class="selflink" id="appendix-B.1.1" href="#appendix-B.1.1">B.1.1</a> HMAC-SHA-1</span>
HMAC-SHA-1 is the pseudorandom function corresponding to the HMAC
message authentication code [<a href="#ref-7" title=""HMAC: Keyed-Hashing for Message Authentication"">7</a>] based on the SHA-1 hash function
[<a href="#ref-18">18</a>]. 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.
<span class="grey">Kaliski Informational [Page 22]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-23" ></span>
<span class="grey"><a href="./rfc2898">RFC 2898</a> Password-Based Cryptography September 2000</span>
(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
application of a hash function to 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.
<span class="h3"><a class="selflink" id="appendix-B.2" href="#appendix-B.2">B.2</a> Encryption Schemes</span>
Example pseudorandom functions for PBES2 (<a href="#section-6.2">Section 6.2</a>) are DES-CBC-
Pad, DES-EDE2-CBC-Pad, RC2-CBC-Pad, and RC5-CBC-Pad.
The object identifiers given in this section are intended to be
employed in the object set PBES2-Encs (Appendix A.4).
<span class="h4"><a class="selflink" id="appendix-B.2.1" href="#appendix-B.2.1">B.2.1</a> DES-CBC-Pad</span>
DES-CBC-Pad is single-key DES [<a href="#ref-15">15</a>] in CBC mode [<a href="#ref-16">16</a>] with the <a href="./rfc1423">RFC 1423</a>
padding operation (see <a href="#section-6.1.1">Section 6.1.1</a>). 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}
<span class="grey">Kaliski Informational [Page 23]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-24" ></span>
<span class="grey"><a href="./rfc2898">RFC 2898</a> Password-Based Cryptography September 2000</span>
The parameters field associated with this OID in an
AlgorithmIdentifier shall have type OCTET STRING (SIZE(8)),
specifying the initialization vector for CBC mode.
<span class="h4"><a class="selflink" id="appendix-B.2.2" href="#appendix-B.2.2">B.2.2</a> DES-EDE3-CBC-Pad</span>
DES-EDE3-CBC-Pad is three-key triple-DES in CBC mode [<a href="#ref-1" title="Triple Data Encryption Algorithm Modes of Operation. Working draft">1</a>] with the <a href="./rfc1423">RFC</a>
<a href="./rfc1423">1423</a> padding operation. 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
[<a href="#ref-1" title="Triple Data Encryption Algorithm Modes of Operation. Working draft">1</a>]; the one given here is preferred since it specifies padding.
<span class="h4"><a class="selflink" id="appendix-B.2.3" href="#appendix-B.2.3">B.2.3</a> RC2-CBC-Pad</span>
RC2-CBC-Pad is the RC2(tm) encryption algorithm [<a href="#ref-21" title=""A Description of the RC2(r) Encryption Algorithm"">21</a>] in CBC mode with
the <a href="./rfc1423">RFC 1423</a> padding operation. 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 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)) }
<span class="grey">Kaliski Informational [Page 24]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-25" ></span>
<span class="grey"><a href="./rfc2898">RFC 2898</a> Password-Based Cryptography September 2000</span>
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.
<span class="h4"><a class="selflink" id="appendix-B.2.4" href="#appendix-B.2.4">B.2.4</a> RC5-CBC-Pad</span>
RC5-CBC-Pad is the RC5(tm) encryption algorithm [<a href="#ref-20" title="Springer-Verlag">20</a>] in CBC mode with
a generalization of the <a href="./rfc1423">RFC 1423</a> padding operation. This scheme is
fully specified in [<a href="#ref-2" title=""The RC5, RC5-CBC, RC5-CBC-Pad, and RC5-CTS Algorithms"">2</a>]. 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.
Note: The generalization of the padding operation is as follows. For
RC5 with a 64-bit block size, the padding string is as defined in <a href="./rfc1423">RFC</a>
<a href="./rfc1423">1423</a>. 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 [<a href="#ref-2" title=""The RC5, RC5-CBC, RC5-CBC-Pad, and RC5-CTS Algorithms"">2</a>] identifies 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 }
<span class="grey">Kaliski Informational [Page 25]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-26" ></span>
<span class="grey"><a href="./rfc2898">RFC 2898</a> Password-Based Cryptography September 2000</span>
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.
<span class="h3"><a class="selflink" id="appendix-B.3" href="#appendix-B.3">B.3</a> Message Authentication Schemes</span>
An example message authentication scheme for PBMAC1 (<a href="#section-7.1">Section 7.1</a>) is
HMAC-SHA-1.
<span class="h4"><a class="selflink" id="appendix-B.3.1" href="#appendix-B.3.1">B.3.1</a> HMAC-SHA-1</span>
HMAC-SHA-1 is the HMAC message authentication scheme [<a href="#ref-7" title=""HMAC: Keyed-Hashing for Message Authentication"">7</a>] based on the
SHA-1 hash function [<a href="#ref-18">18</a>]. HMAC-SHA-1 has a variable key length and a
20-octet (160-bit) message authentication code.
The object identifier id-hmacWithSHA1 (see <a href="#appendix-B.1.1">Appendix B.1.1</a>) 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).
<span class="h2"><a class="selflink" id="appendix-C" href="#appendix-C">C</a>. ASN.1 Module</span>
For reference purposes, the ASN.1 syntax in the preceding sections is
presented as an ASN.1 module here.
-- PKCS #5 v2.0 ASN.1 Module
-- Revised March 25, 1999
-- This module has been checked for conformance with the
-- ASN.1 standard by the OSS ASN.1 Tools
PKCS5v2-0 {iso(1) member-body(2) us(840) rsadsi(113549)
pkcs(1) pkcs-5(5) modules(16) pkcs5v2-0(1)}
DEFINITIONS ::= BEGIN
<span class="grey">Kaliski Informational [Page 26]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-27" ></span>
<span class="grey"><a href="./rfc2898">RFC 2898</a> Password-Based Cryptography September 2000</span>
-- Basic object identifiers
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
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}, ... }
-- PBES1
PBES1Algorithms ALGORITHM-IDENTIFIER ::= {
<span class="grey">Kaliski Informational [Page 27]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-28" ></span>
<span class="grey"><a href="./rfc2898">RFC 2898</a> Password-Based Cryptography September 2000</span>
{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},
...
}
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}},
messageAuthScheme AlgorithmIdentifier {{PBMAC1-MACs}}
<span class="grey">Kaliski Informational [Page 28]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-29" ></span>
<span class="grey"><a href="./rfc2898">RFC 2898</a> Password-Based Cryptography September 2000</span>
}
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},
...
}
id-hmacWithSHA1 OBJECT IDENTIFIER ::= {digestAlgorithm 7}
desCBC OBJECT IDENTIFIER ::=
{iso(1) identified-organization(3) oiw(14) secsig(3)
algorithms(2) 7} -- from OIW
des-EDE3-CBC OBJECT IDENTIFIER ::= {encryptionAlgorithm 7}
rc2CBC OBJECT IDENTIFIER ::= {encryptionAlgorithm 2}
RC2-CBC-Parameter ::= SEQUENCE {
rc2ParameterVersion INTEGER OPTIONAL,
iv OCTET STRING (SIZE(8))
}
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
}
END
<span class="grey">Kaliski Informational [Page 29]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-30" ></span>
<span class="grey"><a href="./rfc2898">RFC 2898</a> Password-Based Cryptography September 2000</span>
Intellectual Property Considerations
RSA Security makes no patent claims on the general constructions
described in this document, although specific underlying techniques
may be covered. Among the underlying techniques, the RC5 encryption
algorithm (Appendix B.2.4) is protected by U.S. Patents 5,724,428
[<a href="#ref-22" title="March 3">22</a>] and 5,835,600 [<a href="#ref-23" title="November 10">23</a>].
RC2 and RC5 are trademarks of RSA Security.
License to copy this document is granted provided that it is
identified as RSA Security Inc. Public-Key Cryptography Standards
(PKCS) in all material mentioning or referencing this document.
RSA Security makes no representations regarding intellectual property
claims by other parties. Such determination is the responsibility of
the user.
Revision history
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.
<span class="grey">Kaliski Informational [Page 30]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-31" ></span>
<span class="grey"><a href="./rfc2898">RFC 2898</a> Password-Based Cryptography September 2000</span>
References
[<a id="ref-1">1</a>] American National Standard X9.52 - 1998, Triple Data Encryption
Algorithm Modes of Operation. Working draft, Accredited
Standards Committee X9, July 27, 1998.
[<a id="ref-2">2</a>] Baldwin, R. and R. Rivest, "The RC5, RC5-CBC, RC5-CBC-Pad, and
RC5-CTS Algorithms", <a href="./rfc2040">RFC 2040</a>, October 1996.
[<a id="ref-3">3</a>] Balenson, D., "Privacy Enhancement for Internet Electronic Mail:
Part III: Algorithms, Modes, and Identifiers", <a href="./rfc1423">RFC 1423</a>,
February 1993.
[<a id="ref-4">4</a>] S.M. Bellovin and M. Merritt. Encrypted key exchange:
Password-based protocols secure against dictionary attacks. In
Proceedings of the 1992 IEEE Computer Society Conference on
Research in Security and Privacy, pages 72-84, IEEE Computer
Society, 1992.
[<a id="ref-5">5</a>] D. Jablon. Strong password-only authenticated key exchange. ACM
Computer Communications Review, October 1996.
[<a id="ref-6">6</a>] Kaliski, B., "The MD2 Message-Digest Algorithm", <a href="./rfc1319">RFC 1319</a>, April
1992.
[<a id="ref-7">7</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-8">8</a>] Robert Morris and Ken Thompson. Password security: A case
history. Communications of the ACM, 22(11):594-597, November
1979.
[<a id="ref-9">9</a>] ISO/IEC 8824-1:1995: Information technology - Abstract Syntax
Notation One (ASN.1) - Specification of basic notation. 1995.
[<a id="ref-10">10</a>] ISO/IEC 8824-1:1995/Amd.1:1995 Information technology - Abstract
Syntax Notation One (ASN.1) - Specification of basic notation -
Amendment 1 - Rules of extensibility. 1995.
[<a id="ref-11">11</a>] ISO/IEC 8824-2:1995 Information technology - Abstract Syntax
Notation One (ASN.1) - Information object specification. 1995.
[<a id="ref-12">12</a>] ISO/IEC 8824-2:1995/Amd.1:1995 Information technology - Abstract
Syntax Notation One (ASN.1) - Information object specification -
Amendment 1 - Rules of extensibility. 1995.
[<a id="ref-13">13</a>] ISO/IEC 8824-3:1995 Information technology - Abstract Syntax
Notation One (ASN.1) - Constraint specification. 1995.
<span class="grey">Kaliski Informational [Page 31]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-32" ></span>
<span class="grey"><a href="./rfc2898">RFC 2898</a> Password-Based Cryptography September 2000</span>
[<a id="ref-14">14</a>] ISO/IEC 8824-4:1995 Information technology - Abstract Syntax
Notation One (ASN.1) - Parameterization of ASN.1 specifications.
1995.
[<a id="ref-15">15</a>] National Institute of Standards and Technology (NIST). FIPS PUB
46-2: Data Encryption Standard. December 30, 1993.
[<a id="ref-16">16</a>] National Institute of Standards and Technology (NIST). FIPS PUB
81: DES Modes of Operation. December 2, 1980.
[<a id="ref-17">17</a>] National Institute of Standards and Technology (NIST). FIPS PUB
112: Password Usage. May 30, 1985.
[<a id="ref-18">18</a>] National Institute of Standards and Technology (NIST). FIPS PUB
180-1: Secure Hash Standard. April 1994.
[<a id="ref-19">19</a>] Rivest, R., "The MD5 Message-Digest Algorithm", <a href="./rfc1321">RFC 1321</a>, April
1992.
[<a id="ref-20">20</a>] R.L. Rivest. The RC5 encryption algorithm. In Proceedings of the
Second International Workshop on Fast Software Encryption, pages
86-96, Springer-Verlag, 1994.
[<a id="ref-21">21</a>] Rivest, R., "A Description of the RC2(r) Encryption Algorithm",
<a href="./rfc2268">RFC 2268</a>, March 1998.
[<a id="ref-22">22</a>] R.L. Rivest. Block-Encryption Algorithm with Data-Dependent
Rotations. U.S. Patent No. 5,724,428, March 3, 1998.
[<a id="ref-23">23</a>] R.L. Rivest. Block Encryption Algorithm with Data-Dependent
Rotations. U.S. Patent No. 5,835,600, November 10, 1998.
[<a id="ref-24">24</a>] RSA Laboratories. PKCS #5: Password-Based Encryption Standard.
Version 1.5, November 1993.
[<a id="ref-25">25</a>] RSA Laboratories. PKCS #8: Private-Key Information Syntax
Standard. Version 1.2, November 1993.
[<a id="ref-26">26</a>] T. Wu. The Secure Remote Password protocol. In Proceedings of
the 1998 Internet Society Network and Distributed System
Security Symposium, pages 97-111, Internet Society, 1998.
[<a id="ref-27">27</a>] Yergeau, F., "UTF-8, a transformation format of ISO 10646", <a href="./rfc2279">RFC</a>
<a href="./rfc2279">2279</a>, January 1998.
<span class="grey">Kaliski Informational [Page 32]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-33" ></span>
<span class="grey"><a href="./rfc2898">RFC 2898</a> Password-Based Cryptography September 2000</span>
Contact Information & 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, SET,
S/MIME, and SSL.
Further development of PKCS occurs through mailing list discussions
and occasional workshops, and suggestions for improvement are
welcome. For more information, contact:
PKCS Editor
RSA Laboratories
20 Crosby Drive
Bedford, MA 01730 USA
pkcs-editor@rsasecurity.com
<a href="http://www.rsalabs.com/pkcs/">http://www.rsalabs.com/pkcs/</a>
<span class="grey">Kaliski Informational [Page 33]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-34" ></span>
<span class="grey"><a href="./rfc2898">RFC 2898</a> Password-Based Cryptography September 2000</span>
Full Copyright Statement
Copyright (C) The Internet Society (2000). All Rights Reserved.
This document and translations of it may be copied and furnished to
others, and derivative works that comment on or otherwise explain it
or assist in its implementation may be prepared, copied, published
and distributed, in whole or in part, without restriction of any
kind, provided that the above copyright notice and this paragraph are
included on all such copies and derivative works. However, this
document itself may not be modified in any way, such as by removing
the copyright notice or references to the Internet Society or other
Internet organizations, except as needed for the purpose of
developing Internet standards in which case the procedures for
copyrights defined in the Internet Standards process must be
followed, or as required to translate it into languages other than
English.
The limited permissions granted above are perpetual and will not be
revoked by the Internet Society or its successors or assigns.
This document and the information contained herein is provided on an
"AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
Acknowledgement
Funding for the RFC Editor function is currently provided by the
Internet Society.
Kaliski Informational [Page 34]
</pre>
|