Hi Nikhil,
You should probably ask Vipul Ved Prakash or someone. I've never
coded a hash in Perl (MD-whatever). And right now I don't have time
to sleep, forget about making a Winduhs-compatible routine.
Regards,
-- Raju
>>>>> "Nikhil" == Nikhil Datta <[EMAIL PROTECTED]> writes:
Nikhil> Raju : 'Perl god' Implement the following for me in perl,
Nikhil> and I'll be eternally grateful. I'll even say your
Nikhil> artciles was nice ;)
Nikhil> Seriously : I need a utility that will take a cleartext
Nikhil> password and dump the equivalent nt and lanmanager hashes
Nikhil> (that samba uses for authentication). The source code is
Nikhil> all available in samba samb/source/smbd/encrypt.c etc. too
Nikhil> bad I can't decipher C too good.
Nikhil> Anyone have an idea where I could find such a utility?
Nikhil> nikk
Nikhil> Here's the algorithm NT uses. interesting, because there's
Nikhil> no salt involved. Why? because if you and me have the same
Nikhil> password, our encrypted hashes will be identical. Isn't
Nikhil> Microsoft smart? After they invented symbolic links
Nikhil> figuring they could save space, they probably decided to
Nikhil> do the same with passwords. After all, if you and me have
Nikhil> the same password why save it twice right ? ;)
Nikhil> Two one-way hashes are stored on the server -- a Lan
Nikhil> Manager password, and a Windows NT password. Lan Manager
Nikhil> uses a 14 byte password. If the password is less than 14
Nikhil> bytes, it is concantenated with 0's. It is converted to
Nikhil> upper case, and split into 7 byte halves. An 8 byte odd
Nikhil> parity DES key is constructed from each 7 byte half. Each
Nikhil> 8 byte DES key is encrypted with a "magic number"
Nikhil> (0x4B47532140232425 encrypted with a key of all 1's). The
Nikhil> results of the magic number encryption are concantenated
Nikhil> into a 16 byte one way hash value. This value is the Lan
Nikhil> Manager "password".
Nikhil> A regular Windows NT password is derived by converting the
Nikhil> user's password to Unicode, and using MD4 to get a 16 byte
Nikhil> value. This hash value is the NT "password".
Nikhil> PS : in case you're curious, this is for a good cause :
Nikhil> i'm trying to integrate *nix and samba authentication via
Nikhil> ldap.
--------------------------------------------------------------------
The mailing list archives are available at
http://lists.linux-india.org/cgi-bin/linux-delhi