Hi,
I am trying to encrypt a string using DES (yes, I know it's insecure, but I need to use it for compatibility with my MUD's savefiles). If I do a call like this:
$encrypted = crypt($login_pass, substr($login_pass, 0, 2));
$encrypted is equal to the salt plus some encrypted string.
This isn't a bug with the crypt() function on my system, as this all works fine from C. I suspect it has something to do with how I'm passing the arguments.
Thank you for any help.
crypt() problems
Moderator: General Moderators
problem?
As far as I can see, the function works in PHP exactly as it does in Cygwin's crypt() function, i.e:
yields the same as$login_pass = "doggie";
$salt = substr($login_pass, 0, 2);
$encrypted = crypt($login_pass, $salt);
print $encrypted
does in Cygwin. both return do4L9dKP87bPQcrypt do doggie