Saturday, 15 February 2014

php - crypt() function returns different result size on different server -



php - crypt() function returns different result size on different server -

i need transfer hashed password on new server old one. old server has php 5.4.4 , crypt() function on password homecoming string 102 characters. new server has php 5.5.7 , crypt function homecoming string of 34 characters. on both server, crypt called without parameters

crypt($password);

on user login (on old server) utilize code:

crypt($_post['password'], $hash_password) == $hash_password

now, if re-create hash passwords new hosting, , phone call method check if password correct, password never match. how can create same type of hashing different server?

this illustration of 2 crypted password:

on old server:

$6$kcpf.fpojej2$yf5ui0np8t5wc0jvvei9.jd2l/zylqgl6t5rn3e5oz3ggiszotbsbocmgglkdlbho6xe7cgdepw7bo6mkfjyx1

on new server

$1$sz1cdmu0$z0uoewnxh1nokqpwwqjsp/

the old server using sha256 algorithm create hashes, new server doesn't seem back upwards it; in other words, constant crypt_sha512 0.

depending on how php installed on new server may have check whether libcrypt recent plenty or contact hosting company provides server.

php password-encryption

No comments:

Post a Comment