PHPass 用法 Posted on 2014-08-06 | In PHP | 1234567891011121314151617181920212223<?php## http://www.openwall.com/phpass/# http://sunnyis.me/blog/secure-passwords/#requeir("PasswordHash.php");## Creating the Hash$password = $_REQUEST['password'];$hasher = new PasswordHash(8, false);$hash = $header->HashPassword($password); // you can store the hash somewhere such as database## Checking "Matched" Passwords$password = $_REQUEST['password'];$hasher = new PasswordHash(8, false);$stored_hash = "this is the hash we stored ealier";$check = $hasher->CheckPassword($password, $stored_hash); // return true if match or false if not match?>