Summary

Non-Goals

In addition to the algorithms listed in the Description section below, PKCS#5
defines several other encryption schemes for PBES2, many of them legacy, i.e.,
DES-CBC-PAD, DES-EDE3-CBC-PAD, RC2-CBC-PAD and RC5-CBC-PAD. Given the lack of
demand for using these legacy encryption schemes with the newer Password-Based
cryptography, e.g., PBES2, there is no plan to provide support for them.

Although the PKCS#11 spec defines some mechanisms for Password Based
Cryptography, the SunPKCS11 provider currently does not support any of them.
The support from the underlying PKCS11 library also seems minimal, e.g.,
Solaris softtoken impl supports only CKM_PBE_SHA1_RC4_128 and CKM_PKCS5_PBKD2.
Thus, this JEP does not include the SunPKCS11 provider in its scope.

PKCS#5 v2.0 Amendment 1: XML Schema for Password-Based Cryptography defines the
XML identifiers for the PBE algorithms defined in PKCS#5 v2.0, but this should
be handled separately in XML code rather than in the SunJCE provider.

Motivation

The currently supported PBE algorithms from the SunJCE provider only cover
DESede, and RC2 (40-bit) with SHA1. To remain competitive we should also
support PBE algorithm implementations with stronger cipher and message digest
algorithms, such as AES cipher and SHA-2 family message digests, as well as
those specified by PKCS#12.

Description

PKCS#12 specifies the following PBE algorithms for its password-privacy mode:

PBEwithSHA1AndRC4_128

PBEwithSHA1AndRC4_40

PBEwithSHA1AndDESede (3-key)

PBEwithSHA1AndDESede (2-key)

PBEwithSHA1AndRC2_128

PBEwthSHA1AndRC2_40

We currently support only 3 and 6. To fully support PKCS12 keystores, we
should add support for all the others.

There have also been demands for password-based cryptography algorithms using
stronger encryption and digest schemes such as AES and SHA-2 family digests.
Thus it we should add support for PBES2 and PBMAC1 (as defined in PKCS#5 v2.1)
as recommended in PKCS#5 for newer applications.

The SunJCE provider will be enhanced to support the following algorithms:

PBEwithSHA1AndRC4_128 cipher

PBEwithSHA1AndRC4_40 cipher

PBEwithSHA1AndDESede (2-key) cipher

PBEwithSHA1AndRC2_128 cipher

and perhaps combinations of the PBES2 cipher algorithms registered using the
algorithm name pattern PBEWith<prf>And<encryption> where

<prf> is one of HmacSHA1, HmacSHA224, HmacSHA256, HmacSHA384, or
HmacSHA512, and