2017 © Pedro Peláez
 

library passwordhash

Portable PHP password hashing framework

image

xjtuwangke/passwordhash

Portable PHP password hashing framework

  • Friday, August 31, 2012
  • by xjtuwangke
  • Repository
  • 1 Watchers
  • 1 Stars
  • 25,632 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 27 % Grown

The README.md

Openwall Phpass, modernized

This is froked from hautelook/phpass , modified to static functions, (*1)

This is Openwall's Phpass, based on the 0.3 release, but modernized slightly:, (*2)

  • Namespaced
  • Composer support (Autoloading)
  • PHP 5 style
  • Unit Tested

The changes are minimal and only stylistic. The source code is in the public domain. We claim no ownership, but needed it for one of our projects, and wanted to make it available to other people as well., (*3)

Installation

Add this requirement to your composer.json file and run composer.phar install:, (*4)

{
    "require": {
        "hautelook/phpass": "dev-master"
    }
}

Usage

The following example shows how to hash a password (to then store the hash in the database), and how to check whether a provided password is correct (hashes to the same value):, (*5)

``` php <?php, (*6)

namespace Your\Namespace;, (*7)

use Hautelook\Phpass\PasswordHash;, (*8)

require_once(DIR . "/vendor/autoload.php");, (*9)

$passwordHasher = new PasswordHash(8,false);, (*10)

$password = $passwordHasher->HashPassword('secret'); var_dump($password);, (*11)

$passwordMatch = $passwordHasher->CheckPassword('secret', "$2a$08$0RK6Yw6j9kSIXrrEOc3dwuDPQuT78HgR0S3/ghOFDEpOGpOkARoSu"); var_dump($passwordMatch);, (*12)

The Versions

31/08 2012

dev-master

9999999-dev http://github.com/xjtuwangke/passwordhash/

Portable PHP password hashing framework

  Sources   Download

public domain

The Requires

  • php >=5.3.3

 

security password blowfish crypt