crypt() results

dennis_marti at dennis_marti at
Mon Apr 24 10:53:14 EDT 2000

In article <Pine.BSF.4.10.10004232258410.24749-100000 at>,
  "Michal Wallace (sabren)" <sabren at> wrote:
> Well. I tried porting both Crypt::UnixCrypt and Crypt::PasswdMD5 to
> python.  And neither one of the python versions give the same results
> as the perl versions. They come out in the same format, but with
> different values.
> I've pounded my head, pulled out my hair, and finally given up. I
> simply don't know enough about the algorithms or perl's bit twiddling
> to understand what these modules are actually doing.

It wasn't in the bit twiddling. You reversed the conditionals in the
first for loop in unix_md5_crypt().

/home/dennis $ diff
<             ctx = ctx + final[:16]
<         else:
>         else:
>             ctx = ctx + final[:16]

Hope you didn't lose too much hair.

Dennis Marti

Sent via
Before you buy.

More information about the Python-list mailing list