# Re: JCE Cipher.getInstance method

Jan Luehe (Jan.Luehe@Eng)
Tue, 20 May 1997 20:04:22 -0700

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Crooks, Michael A.: "Be aware of somethings that are being said"
- Previous message: Dhaval M Shah: "JCE interfaces"

    Date: Tue, 20 May 1997 20:04:22 -0700

    From: Jan.Luehe@Eng (Jan Luehe)

    Message-Id: <199705210304.UAA27195@mosel.eng.sun.com>

    To: java-security@web2.javasoft.com, mchisam@starsky-13.East.Sun.COM

    Subject: Re: JCE Cipher.getInstance method

Mark:

> How do you correctly specify CBC, and PKCS5 padding
> via the Cipher.getInstance(x) methods? I dont see this
> in the html docs.

Yes, this is missing.

In the current approach, you would specify the above algorithm as
follows:

Cipher cipher = Cipher.getInstance("DES/CBC/PKCS#5");

There are two problems with the above specification:

1. The specification of the algorithm with its mode and padding scheme
is very cumbersome and user-unfriendly.
We are looking at improving this by introducing new "Cipher"
methods which will allow you to specify the algorithm mode and
padding scheme separately, and not as part of the algorithm name.
Here's an example:

Cipher c = Cipher.getInstance("DES");
CipherMode cm = new CBC(initializationVector);
c.setMode(cm);
c.setPadding(new PKCS#5());

2. The "SUN" provider that comes as the default with the current JCE does
not implement DES in CBC mode. The only mode currently implemented is ECB.

Jan

- Next message: Crooks, Michael A.: "Be aware of somethings that are being said"
- Previous message: Dhaval M Shah: "JCE interfaces"