I have been doing some research on creating some different hashes, etc. I am aware of the password_hash()
function, however I'm currently creating an initialization value using mcrypt. The issue that is arising is some of the hashed password being clipped if the password is larger than 8 characters.
My current code adds a salt (created by mcrypt_create_iv()
) to a users password. Afterwards it is encrypted using the hash() function. The criteria for a password is anywhere from 8->40 characters.
My column in MySQL looks like varchar (64) using latin1_swedish_ci collation.
How would I calculate the maximum length (MySQL length) that the initialization value could be, as well as the maximum length for the user-inputted password?
Disclaimer: I purposefully left out the encryptions, but will appreciate any documentation for different cipher block init value lengths as well as hash lengths. (Not sure the terminology, hope that makes sense.)