2017 © Pedro Peláez
 

library phpass

Portable PHP password hashing framework

image

ozh/phpass

Portable PHP password hashing framework

  • Monday, May 22, 2017
  • by ozh
  • Repository
  • 1 Watchers
  • 0 Stars
  • 324 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 8 % Grown

The README.md

Openwall Phpass, modernized

Build Status, (*1)

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

  • Namespaced
  • Composer support (Autoloading)
  • Unit Tested

The modernization has been done by Hautelook, from whom I stole this library to originally repackage it for PHP 5.3 to 7.0 compatibility in a single file and branch (Hautelook's port consisting of two branches, one for PHP 5.3 to 5.5, and another one for 5.6+)., (*3)

Current version requires PHP 5.6+, (*4)

Installation

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

{
    "require": {
        "ozh/phpass": "1.3.0"
    }
}

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):, (*6)

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

namespace Your\Namespace;, (*8)

use Ozh\Phpass\PasswordHash;, (*9)

require_once(DIR . "/vendor/autoload.php"); // or require_once('path/to/src/Ozh/Phpass/PasswordHash.php');, (*10)

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

// Encrypt $password = $passwordHasher->HashPassword('secret'); var_dump($password); // Will output something like: // '$2a$08$a6XFLs8SrjClF1szoDDkI.6gtWVb4//QnzUjkxlus83AKCNjuD8Ha' (length=60) // '$2a$08$Qze1smZ//VAwHJ1t52zklOY/yLwlbKR6Ighf6B7uqGXdYVozTPEdG' (length=60) // '$2a$08$u2uKfE9igO.Cz0SptWxlXeVi0CQglfl3FdRK3YpbGm1NfF1d.CFPm' (length=60), (*12)

// Decrypt var_dump( $passwordHasher->CheckPassword('secret', '$2a$08$0RK6Yw6j9kSIXrrEOc3dwuDPQuT78HgR0S3/ghOFDEpOGpOkARoSu') ); // true var_dump( $passwordHasher->CheckPassword('secret', '$2a$08$Qze1smZ//VAwHJ1t52zklOY/yLwlbKR6Ighf6B7uqGXdYVozTPEdG') ); // true var_dump( $passwordHasher->CheckPassword('secret', '$2a$08$u2uKfE9igO.Cz0SptWxlXeVi0CQglfl3FdRK3YpbGm1NfF1d.CFPm') ); // true, (*13)

The Versions

22/05 2017

dev-master

9999999-dev http://github.com/ozh/phpass/

Portable PHP password hashing framework

  Sources   Download

public domain

The Requires

  • php >=5.3.0

 

The Development Requires

security password blowfish crypt

18/05 2017

1.2.0

1.2.0.0 http://github.com/ozh/phpass/

Portable PHP password hashing framework

  Sources   Download

public domain

The Requires

  • php >=5.3.0

 

security password blowfish crypt

31/08 2012

0.3.0

0.3.0.0 http://github.com/hautelook/phpass/

Portable PHP password hashing framework

  Sources   Download

public domain

The Requires

  • php >=5.3.3

 

security password blowfish crypt

31/08 2012

0.3.3

0.3.3.0 http://github.com/hautelook/phpass/

Portable PHP password hashing framework

  Sources   Download

public domain

The Requires

  • php >=5.3.3

 

security password blowfish crypt

31/08 2012

0.3.4

0.3.4.0 http://github.com/hautelook/phpass/

Portable PHP password hashing framework

  Sources   Download

public domain

The Requires

  • php >=5.3.3

 

security password blowfish crypt

31/08 2012

0.3.5

0.3.5.0 http://github.com/hautelook/phpass/

Portable PHP password hashing framework

  Sources   Download

public domain

The Requires

  • php >=5.3.3

 

security password blowfish crypt

31/08 2012

1.0.0

1.0.0.0 http://github.com/hautelook/phpass/

Portable PHP password hashing framework

  Sources   Download

public domain

The Requires

  • php >=5.6.0

 

security password blowfish crypt

31/08 2012

1.1.0

1.1.0.0 http://github.com/hautelook/phpass/

Portable PHP password hashing framework

  Sources   Download

public domain

The Requires

  • php >=5.6.0

 

security password blowfish crypt