in reply to crypt strangeness

Under the version of Linux I'm running, crypt("hello", "he") returns "heFw0NKyvGSTg", but crypt("hello", "\$1\$foo") returns $1$foo$.NqwPL8dJlpNqGUbqbE2N/. My guess is that the C library is automatically detecting the digest format from the salt.

Also check Crypt::DES, remember that the password is the key, and the ciphertext is all nulls IIRC.

Of course, if you have the option of choosing whatever digest format you want, go for Digest::SHA1.