PHPackages                             ozh/phpass - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. ozh/phpass

AbandonedArchivedLibrary[Security](/categories/security)

ozh/phpass
==========

Portable PHP password hashing framework

1.4.0(4y ago)375.2k↓26.7%1Public DomainPHPPHP &gt;=5.6

Since Aug 31Pushed 4y ago1 watchersCompare

[ Source](https://github.com/ozh/phpass)[ Packagist](https://packagist.org/packages/ozh/phpass)[ Docs](http://github.com/ozh/phpass/)[ RSS](/packages/ozh-phpass/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (10)Used By (0)

Openwall Phpass, modernized
===========================

[](#openwall-phpass-modernized)

[![Build Status](https://camo.githubusercontent.com/77e373de1171ad8f8436b5a81c5e9c196bcc52468b9fa78bc4fdc2bca6e525f2/68747470733a2f2f6170702e7472617669732d63692e636f6d2f6f7a682f7068706173732e7376673f6272616e63683d6d6173746572)](https://app.travis-ci.com/github/ozh/phpass)

This is Openwall's [Phpass](http://openwall.com/phpass/), based on the 0.5 release, but modernized slightly:

- 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+).

Current version requires PHP 5.6+

Installation
------------

[](#installation)

Add this requirement to your `composer.json` file and run `composer install`:

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

```

Usage
-----

[](#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):

```
