# Re: quick question on DES in jce

Marianne Mueller (mrm@Eng)
Fri, 27 Jun 1997 13:45:48 -0700

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Marianne Mueller: "test 2"
- Previous message: Dave Miller: "quick question on DES in jce"
- Maybe in reply to: Dave Miller: "quick question on DES in jce"

    Date: Fri, 27 Jun 1997 13:45:48 -0700

    Message-Id: <199706272045.NAA17028@puffin.eng.sun.com>

    From: Marianne Mueller <mrm@Eng>

    To: dmiller@preemptive.com

    Subject: Re: quick question on DES in jce

Hi,

This should work OK using the code you cite - you might need to make
sure the jce.zip package is installed in the same place as your other
JDK zip file.

>From the README,

Once you have installed the JCE, you need to add the zip file to your
CLASSPATH.

On Solaris,

% setenv CLASSPATH <your-jdk-directory>/lib/jce.zip

On Windows,

% set CLASSPATH=<your-jdk-directory>\lib\jce.zip

If you already have a JDK zip file explicitly on your CLASSPATH, then
make sure this one precedes that.

You shouldn't need to have any JDK zip file explicitly on your
CLASSPATH, though. People sometimes do that but it shouldn't be
required.

Here's the typical way to initialize a cipher object for DES:

// Initialize a cipher object for DES

cipher = Cipher.getInstance("DES/ECB/PKCS#5");
cipher.initEncrypt(desKey);

The JCE distribution has a simple demo file that uses that.

Marianne

- Next message: Marianne Mueller: "test 2"
- Previous message: Dave Miller: "quick question on DES in jce"
- Maybe in reply to: Dave Miller: "quick question on DES in jce"