Created
May 8, 2013 14:08
-
-
Save mcatta/5540674 to your computer and use it in GitHub Desktop.
Android/Java convert String to MD5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static String convertPassMd5(String pass) { | |
String password = null; | |
MessageDigest mdEnc; | |
try { | |
mdEnc = MessageDigest.getInstance("MD5"); | |
mdEnc.update(pass.getBytes(), 0, pass.length()); | |
pass = new BigInteger(1, mdEnc.digest()).toString(16); | |
while (pass.length() < 32) { | |
pass = "0" + pass; | |
} | |
password = pass; | |
} catch (NoSuchAlgorithmException e1) { | |
e1.printStackTrace(); | |
} | |
return password; | |
} |
Thank you!
i see. this work.. but how to descrytion to value string
@walageri Hashs can only be performed in one direction.
You can't decrypt => Instead you can convert string (password) to Hash again and compare with previous generated value
thanks :)
thank you =)
Thank you a lot :)))
thanks a lot :)))
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to Decryption the md5 value to string value