Win a copy of Java Persistence with Spring Data and Hibernate this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

Data Encryption & Decryption in Java

 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
MD5 is a hashing algorithm, not an encryption algoritm. You are not meant to be able to get the original value from it.
 
Rancher
Posts: 43075
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
A wop bop a lu bob a womp bam boom. Tutti frutti ad:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic