crypt(3) confusion

Skip Montanaro skip at mojam.com
Wed Oct 13 10:21:42 UTC 1999


I was reading the contact template examples page at

    ftp://www.networksolutions.com/templates/contact-template-examples.txt

in preparation for an update to my contact info.  For the auth info section
it gave an example encrypted password of "%.d!Hr3 at rm.Gh" which it said was
the encryption for the password "HELLO".  It said to use the crypt(3)
library function to generate the encrypted password.

Figuring I could call Python's crypt.crypt function to generate the
password, I tried:

    >>> import crypt
    >>> crypt.crypt("HELLO", "%.")
    '%.oskKrxF9sUk'

This was confusing (it not matching the example), so I tried it in C and
Perl and got the same result.  Then I checked the docs.  The crypt man page
and the documentation for Python's crypt module on my RedHat 5.2 systems
indicate the characters in the salt must be drawn from the set [a-zA-Z/.],
yet the example clearly used a salt of "%.".

Can I trust my eyes (and my crypt(3) function) or is there a problem with
Network Solutions' example?

Thx,

Skip Montanaro | http://www.mojam.com/
skip at mojam.com | http://www.musi-cal.com/
847-971-7098   | Python: Programming the way Guido indented...


More information about the bind-users mailing list