Actually, figured it out. I was using the wrong salt value when doing the encryption.
In case others are wondering, the salt is found in the password file itself.
For MD5 based encryption (most modern) you'd have an encrypted pw that looks like this:
$1$wdU/3pY0$JRiqShV.12p6g8SabcT1fu
the salt value is: $1$wdU/3pY0$
so:
crypt("userEnteredPw", "$1$wdU/3pY0$");
Will give you: $1$wdU/3pY0$JRiqShV.12p6g8SabcT1fu
For DES, the password entry looks like this
A5di39f9k934d
the salt value is the first two characters: A5
so
crypt("userEnteredPW", "A5")
Will give you: A5di39f9k934d
All of the above is from the GNU C Library manual:
http://www.gnu.org/software/libc/man...ibc.html#crypt