PHP Security Password Protection with the hash_hmac function

October 21st, 2011 by Regaz

PHP 5 Password Security Protection with hash_hmac




This function represents in PHP 5 the Best Hashing Tool.

It’s enabled by Default from PHP version 5.1+ It dispose of Several Hashing Algorithms and between them: MD5, SHA1, SHA256 and SHA512. For a complete list of Hash Algorithms view Output of the hash_algos() function.

The function take Up to 4 Arguments and only the last is Optional:

PHP 5 Password Security Protection with hash_hmac - Featured
  1. The Algorithm in Use
  2. The Data to be Hashed
  3. The Hash Key
    which make the generated Hash Unique.
    The Key must be Used when Comparing two Hashes.
  4. The Hash Output Format
    this is Optional. True give a raw Binary and False Hexadecimal chars.

Example:

hash_hmac('sha256', $password, 'xyzhkj', true)
(Visited 1 times, 1 visits today)

Tags:


Comments are disabled