MD4 and DES for unicode strings (samba passwd file manipulation)

Arcady Genkin agenkin at
Wed Sep 4 17:23:01 EDT 2002

martin at (Martin v. Loewis) writes:

"Fredrik Lundh" <fredrik at> writes:

> if you want a string of 16-bit little-endian unicode characters,
> make sure you have one:
>     m =
>     m.update(password.encode("utf-16-le"))
>     m.hexdigest().upper()
> (I don't have the MD4 library, so I cannot verify this.  But if
> it works, it works for both 8-bit strings with ASCII text, and
> Unicode strings)

Yep, this works.  Thank you both very much!
Arcady Genkin : CDF sysadmin :

guilt is the cause of more disauders
than history's most obscene marorders                       (E.E. Cummings)

More information about the Python-list mailing list