Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] MD5 password obfuscation not cooperating

On Fri, 8 Dec 2017, Greg Wilkins wrote:

Steven,
I don't get different results?

With the code:

      MD5 m1 = (MD5)Credential.getCredential(MD5.digest("123foo"));
System.err.println(TypeUtil.toHexString(m1.getDigest()));


I get Bb07Dc9b660a99356c244eFd99254306

With the unix command

      echo -n 123foo | md5sum


I get bb07dc9b660a99356c244efd99254306

Are you sure you sure you don't have a trailing CR ?   The -n is important!

<sigh..> Yes, it appears I got myself wrapped in a circle. I _thought_ I was seeing different results with the Tomcat hashing tool, but as you point out I was probably using 'md5sum' and processing the newline character.

Just went back and re-checked. Indeed, all three methods produce the same hash. Sorry about that!

Would be a good idea to update the documentation with details for setting up obfuscated MD5 hash for digest auth.

Thanks very much for your help and responsiveness.



--

Back to the top