Connecting Tech Pros Worldwide Forums | Help | Site Map

NT/LM and Unix Crypt Hash Creation in C#

bb
Guest
 
Posts: n/a
#1: Nov 17 '05
I have a requirement to create and store in our database the users
password in a couple of additional hashes (we currently store an MD5
hash)

the spec is pretty brief...

Spec:
Store the NT Hash and Unix Crypt of password when a user
creates/modifies password
End.

Ive had a sniff around and not really found many good resources on how
these methods of hash creation are performed. I understood unix crypt
uses DES and i get a result like this when doing it on the unix shell

$ crypt google
nWw/IiIxKckm2

the NT/LM one seems to be a bit different, and various websites suggest
there are two hashes "The NTLM, NTLMv2, and Kerberos all use the NT
hash, also known as the Unicode hash. The LM authentication protocol
uses the LM hash."

I'd like to know how to create both!

Any pointers on this about preferably inbuild c# classes which will
create these hashes, or some keywords or urls for me to have a sniff
on.

Chris Priede
Guest
 
Posts: n/a
#2: Nov 17 '05

re: NT/LM and Unix Crypt Hash Creation in C#


Hi,

bb wrote:[color=blue]
> I understood unix crypt uses DES and i get a
> result like this when doing it on the unix shell[/color]

This may or may not be relevant to your project, but MD5 crypt is more
commonly used today, while DES crypt is supported mainly for backwards
compatibility. MD5 encrypted password strings begin with the magic
characters "$1$" and are significantly longer.

Reference code for either of these should be very easy to find, thanks to
Linux and FreeBSD -- just Google something like "DES crypt source" or "MD5
crypt source".


--
Chris Priede


Closed Thread