aspose file tools*
The moose likes Java in General and the fly likes Data Encryption & Decryption in Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Data Encryption & Decryption in Java" Watch "Data Encryption & Decryption in Java" New topic
Author

Data Encryption & Decryption in Java

Hari Dhanakoti
Ranch Hand

Joined: Jan 07, 2008
Posts: 74
Hi all,

I am now working with encryption and decryption algorithm in java.
As of now i am making use of the MD5 algorithm to encrypt the data.
I can encrypt the value to a hexadecimal values.

I am not able to get original String value after decryption.

Is there is any way to achieve the original data?

If not how can we convert the hexadecimal values to Strings?
Please help me out ASAP..

I am totally hanged up with this issue.


Regards,
Hari
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

MD5 is a hashing algorithm, not an encryption algoritm. You are not meant to be able to get the original value from it.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41906
    
  63
MD5 is not cipher, but a hash or digest. The difference is that ciphers can be reversed (in other words, you can get back the original text), but digests can't.

So for encryption -where you want the original text back- you can't use MD5. Ciphers you could use include AES, DESede and Blowfish, amongst others.

The http://faq.javaranch.com/java/SecurityFaq contains several links regarding the use of the JCE API which may be helpful.


Ping & DNS - my free Android networking tools app
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Data Encryption & Decryption in Java