Creating an NT-Password value with python

jon michaels joniamasad at gmail.com
Sat Nov 21 21:04:43 CET 2009


On Sat, Nov 21, 2009 at 10:08 PM, Alan DeKok <aland at deployingradius.com> wrote:
>  Use the hex version of the password:
>
>        NT-Password := 0x0102030405060708...
>
>  Alan DeKok.

Thanks, that worked like a charm. As it turns out, i don't even need
python_ntlm for more than the right line of code. This snippet will
create a NT-Password hash that both mysql and radius are happy with:

Python 2.5.2 (r252:60911, Jul 22 2009, 15:35:03)
>>> import hashlib
>>> nt_password = hashlib.new('md4', 'test'.encode('utf-16le')).hexdigest()
>>> nt_password
'0cb6948805f797bf2a82807973b89537'

In the example, 'test' is the password.

Cheers,

Jon.




More information about the Freeradius-Users mailing list