Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to decript field which is encripted by MD5

 
kamal dobaria
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

There is a need to decript a field which is encripted by MD5 function as follows,

MessageDigest md = MessageDigest.getInstance("MD5");
md.update(barray);
byte[] result = md.digest();

Can anyone help me how to decript this field which is encripted by MD5?

-Kam
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
MD5 is not a cipher; it is a hash. One of the differences is that ciphers can be decrypted, while hashes can not - they are a one-way function. So what you are asking is fundamentally impossible.
 
Kishore Dandu
Ranch Hand
Posts: 1934
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree with Ulf.

You can only compare and say it is what is intended to be moved across the wire(purely for authentication purposes). You can not see the original content though.

Why not use a cypher like AES(Rijndael)??
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic