The messageboard I am moving to uses Perl's crypt() function to encypher the user's passwords. I don't know Perl, but know PHP and am writing the converter in PHP using PHP's supposedly similar crypt() function, but it does not always encypher correctly (passwords that should work, don't - but there does not seem to be a pattern).
As of now, I have tested the following as salts:
- the username(unadulterated)
- the first two characters of the username, unadulterated as well
- the first two characters of the username converted to lowercase
I find it interesting that some of the passwords should work and others do not in each of the tested cases. Further, I still have not been able to find a pattern as far as which logins and passwords should work in any of the cases.
Has anyone else had similar issues? Any solutions?
if (crypt($guess, $cryptpw) ne $cryptpw) {
die "Sorry...\n";
} else {
print "ok\n";
}