[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: perl and md5 crypt



Brian Clark wrote:

> * john (johnpf@atnet.net.au) [Jan 13. 2002 21:51]:
>
> > > > Isnt that how the man page says to do it?
>
> > > Which man page?
>
> > man 3 crypt
>
> Ah, I took your statement to mean some perldoc stated "this is how
> you generate md5 passwords with perl."
>
> Thedore might need to install manpages-dev in that case.
>

My understanding is that when perl is built it looks to see if there is a 'C'
crypt it can use, and uses that in
preference to implementing it itself. This is A Good Thing as it allows you to
do all sorts of funky things to your crypt(3) function and have them work in
many languages. man perlfunc _almost_ implies this in the section on crypt:

 crypt PLAINTEXT,SALT
               Encrypts a string exactly like the crypt(3) func­
               tion in the C library (assuming that you actually
               have a version there that has not been extirpated
               as a potential munition).  This can prove useful
               for checking the password file for lousy pass­
               words, amongst other things.  Only the guys wear­
               ing white hats should do this.

It's hard to be _exactly_ like crypt(3) unless it uses it, given that crypt(3)
is often replaced in some installations (eg where a cryptocard is used).

But then I hit the problem Theodore hit quite a while back (2, 3 years?). I've
never forgotten that little add-on to the crypt(3) manpage though.




Reply to: