Hi I have used MessageDigest class to encrypt password and then store it in the database. I know I can compare the password with what user enters by encrypting what user enters but I also want to be able to read and display actual password. How do I decrypt that.
Following is the simple code I am using to encrypt
md = MessageDigest.getInstance( "SHA-1" );
md.update( plainText.getBytes("UTF-8") ); (plainText is what needs to be converted)
byte[] raw = md.digest() ;
String hash = ( new BASE64Encoder()).encode( raw ) ;
return hash ;
Now I want to know with this "hash" value provided how can I get back my plain text.
Thanks
Imad