Date: Tue, 20 Jan 1998 11:13:55 -0800 (PST)
From: Jan Luehe <Jan.Luehe@Eng>
Subject: Re: JCE 1.2 Problems
To: java-security@web2.javasoft.com, cieslakd@ssax.com
> From: "Dan Cieslak" <cieslakd@ssax.com>
> To: <java-security@web2.javasoft.com>
Dan:
When I run your DESexample, I get the following:
java DESexample
java.security.NoSuchAlgorithmException: Wrong transformation format
at javax.crypto.Cipher.getInstance(Cipher.java:147)
at DESexample.main(DESexample.java:33)
This is because you specified
Cipher.getInstance("DES/ECB")
when you created an instance of Cipher.
However, a transformation (the string that you pass to the
getInstance() method) is composed of either one element
(the algorithm name) or 3 elements (the algorithm name, mode,
and padding). A transformation with only 2 elements is invalid.
Please try
Cipher.getInstance("DES/ECB/PKCS5Padding")
and your program will work.
In your PBEexample, you forgot to register the SunJCE provider.
Please register it in the same way as you did in DESexample,
and your program will work.
Thanks,
Jan