wood burning stoves 2.0*
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
Author

No Such Algorithm Exception

jason zepris
Greenhorn

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

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

Exception in thread "main" java.security.NoSuchAlgorithmException: 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.

See http://docs.oracle.com/javase/1.5.0/docs/guide/security/jce/JCERefGuide.html
jason zepris
Greenhorn

Joined: Jun 25, 2011
Posts: 8
Yeah I did confuse it. Thank you very much.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: No Such Algorithm Exception
 
Similar Threads
BadPaddingException with DES
AES Encryption/Decrypton
AES encryption
Encrypted values all contain same final characters
javax.crypto with sun AND ibm...