File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Security and the fly likes No Such Algorithm Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Security
Bookmark "No Such Algorithm Exception" Watch "No Such Algorithm Exception" New topic

No Such Algorithm Exception

jason zepris

Joined: Jun 25, 2011
Posts: 8
Hi All,

I am using Java 1.6 and am getting the following exception:

Exception in thread "main" no such algorithm: AES/CBC/PKCS5Padding for provider SunJCE

Any one know what's wrong? I've read that this algorithm should be available for this provider.
Tim McGuire
Ranch Hand

Joined: Apr 30, 2003
Posts: 820

I think you are mixing up KeyGenerator.getInstance and Cipher.getInstance

KeyGenerator.getInstance only takes an String for algorithm so getInstance("AES","JCE") is what you want

Cipher takes a string for transformation which is what you are trying to give.

jason zepris

Joined: Jun 25, 2011
Posts: 8
Yeah I did confuse it. Thank you very much.
I agree. Here's the link:
subject: No Such Algorithm Exception
jQuery in Action, 3rd edition