This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Web Services and the fly likes How to verify if a string value is a plain text or MD5 converted Hex value Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "How to verify if a string value is a plain text or MD5 converted Hex value" Watch "How to verify if a string value is a plain text or MD5 converted Hex value" New topic
Author

How to verify if a string value is a plain text or MD5 converted Hex value

Sam Saha
Ranch Hand

Joined: Jan 23, 2010
Posts: 104
Hi. I am very new to web service development world. I am extracting the password from which is md5 encripted hex data. Now I am taking the the password value from the property file. From the property file the password could a plain text or MD5 encripted value. Now after I get the value from perperty file first I have to check if it is a plain text value or md5 encripted hex value. How would I check if a string value is a plain text or md5 encripted hex value. I would really appreciate if someone can give me any idea. Please let me know if I am not clear enough or need any other informations. Thank you very much.
Richard Tookey
Ranch Hand

Joined: Aug 27, 2012
Posts: 1035
    
  10

HEX encoding results in 'plain text' so one cannot for sure determine that a value is the password or the HEX encoded MD5 digest of the password. What one can say is that a HEX encoded MD5 digest will contain exactly 32 characters taken from the set [0-9,A-F,a-f] . I don't know of anybody who uses passwords anywhere near that specification so if an entry does match that specification then I would bet that it is a HEX encoded MD5 digest.

It is relatively simple to write a regular expression to check for an entry meeting the HEX encoded MD5 digest specification.

P.S. MD5 is a 'digest' and not an 'encryption'. It cannot be 'decrypted' .
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to verify if a string value is a plain text or MD5 converted Hex value
 
Similar Threads
extract and save to file certificate and key from pkcs12 file programmatically
login/password question
Is it secure to turn hashed passwords into a string or the hash value should be ALWAYS kept as char?
converting a byte array to hex values
Need Help in Encryption