• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

No Such Algorithm Exception

 
jason zepris
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 820
IntelliJ IDE Tomcat Server VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah I did confuse it. Thank you very much.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic