This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Security and the fly likes How to use IDEA cyptography agorithm from the JCE Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Security
Bookmark "How to use IDEA cyptography agorithm from the JCE" Watch "How to use IDEA cyptography agorithm from the JCE" New topic
Author

How to use IDEA cyptography agorithm from the JCE

Gary Warren
Greenhorn

Joined: Dec 28, 2010
Posts: 2
Hi
Does anyone have a sample of how to use the IDEA encrypt and decrypt algorithms from the JCE. Specifically what cipher values to use (ECB, padding, etc...)?
Thanks
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41057
    
  43
The standard JCE provider which comes with the JRE does not contain an IDEA implementation. You'll have to use a provider that does, like the one from bouncycastle.org.


Ping & DNS - my free Android networking tools app
Gary Warren
Greenhorn

Joined: Dec 28, 2010
Posts: 2
Thanks for your reply. Now using Bouncy Castle and have a few more questions...

How do I serialize a KEY value to a file (a Bouncy Castle KEY). I am getting a non serializable error.
I can encrypt with a password using SecretKeyFactory and PBEKeySpec but do you have an example of
how to decrypt with a password?
Thanks again for your help...
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41057
    
  43
What do you mean by "key value" - a PBEKeySpec? Not sure, but you can get all its constituent parameters from it, and store those.

You can find some example code for how to do encrypting/decrypting with JCE at https://www.coderanch.com/how-to/java/SecurityFaq#encryption. Those examples are for other algorithms, but the basic principles are the same.
 
Consider Paul's rocket mass heater.
 
subject: How to use IDEA cyptography agorithm from the JCE
 
Similar Threads
JCE API
Encryption and Decryption for Transaction
Exception in thread "main" java.security.InvalidKeyException:
JCE and binary private keys
168 bit 3DES encryption and decryption....