crypt() results

dennis_marti at yahoo.com dennis_marti at yahoo.com
Mon Apr 24 16:53:14 CEST 2000


In article <Pine.BSF.4.10.10004232258410.24749-100000 at chi.pair.com>,
  "Michal Wallace (sabren)" <sabren at manifestation.com> 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 md5crypt.py md5crypt.py.orig
73,74d72
<             ctx = ctx + final[:16]
<         else:
75a74,75
>         else:
>             ctx = ctx + final[:16]

Hope you didn't lose too much hair.

Dennis Marti


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list