aspose file tools*
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


Win a copy of Java 8 in Action this week in the Java 8 forum!
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.
 
Consider Paul's rocket mass heater.
 
subject: No Such Algorithm Exception
 
Similar Threads
Encrypted values all contain same final characters
AES encryption
AES Encryption/Decrypton
javax.crypto with sun AND ibm...
BadPaddingException with DES