Crypt
Crypt() is Unix C library function used for hashing passwords
Hash
A hash function is any well-defined procedure or mathematical function that converts a large amount of data into a small datum, usually a single integer. For questions about hashtags as used to label content on social media, use hashtag. For questions about URLs and HTML anchors, use fragment-identifier
Others
Example |
---|
To generate a bcrypt hash it is much safer to use the new password_hash function though there exists also a compatibility pack for earlier php versions from question How can i set blowfish for CRYPT_BLOWFISH function in php |
The second hashing function is hash which supports many more algorithms and variants than crypt but does not support some algorithms that crypt does from question Best way to secure user passwords in a mysql database? |
Notably backwards compatibility the password functions are essentially a well-written wrapper around crypt and are inherently backwards-compatible with crypt -format hash even if they use obsolete and or insecure hash algorithms from question How to use PHP's password_hash to hash and verify passwords |
Hash is newer and seems to support more hashing alogrithms than crypt from question Hash() vs. crypt() function comparison |