phpass class encryption algorithm

Customers say hackable with md5 encryption, requires the use of bcrypt encryption, the search found password_hash function can easily achieve salted password encryption, more secure than md5, the disadvantage is running slow.

phpass is an open source library, it allows us to more easily use bcrypt encryption algorithm.

Download: http: //www.openwall.com/phpass/

use:

// class file introducing
require 'PasswordHash.php';

// Initialize hasher is not portable, better security. encrypted string 60 is false, true encryption is 34 characters

$hasher = new PasswordHash(8, true);

// perform encryption

$hashedPassword = $hasher->HashPassword('test123');

//verification

$hasher->CheckPassword('test123', $hashedPassword);  // true

test.php file more use can be viewed in the download library

Use phpass class encryption without additional salt

Guess you like

Origin www.cnblogs.com/wheats/p/11284455.html