Password encryption in 2.2.0

Richard Sharpe sharpe at
Sat Apr 28 05:06:30 GMT 2001

At 12:17 AM 4/28/01 -0400, Michael B. Allen wrote:
>> Michael, What Jerry is saying is that the hashs are not sent over the wire.
>> They are used as the key, after adding a few bytes, to encrypt the
>> If the hash the client has matches the hash the server has, they will each
>> compute the exact same response, and the user has proven s/he is who s/he
>> claims to be (modulo disclosure of the password).
>Actually I think I understand. If the algo is:
>P24 = E(MD4(U(PN) + 5 NULLs, C8))
>Then your just doing the:
>MD4(U(PN) + 5 NULLs
>part first and that's whats in the smbpassword file? 

Close ... Just the MD4(PW) is kept in the smbpasswd file for the NT
Password. It is not converted to upper case.

However, the LanMan hash is also kept there, and that is really bogus. It
does UC the password, and splits it into two 7-Char (56-bit) keys to DES.

It is described in Special Edition, Using Samba as well as the code.

>                                    For some reason I
>was thinking there was no way to get the P24 to compair without rehashing
>plaintext with the new challange in which case you would have no other
>choice but to store plain text. But I see now there's an intermediate
>hash that does NOT depend on C8.
>Thanks. Sorry for the bother. Nothing to see here. Moving on :~)
>signature pending

Richard Sharpe, sharpe at
Samba (Team member,, Ethereal (Team member,
Contributing author, SAMS Teach Yourself Samba in 24 Hours
Author, Special Edition, Using Samba

More information about the samba-technical mailing list