Full Code of ircmaxell/PHP-PasswordLib for AI

master 692d16877883 cached
144 files
3.1 MB
822.8k tokens
670 symbols
1 requests
Download .txt
Showing preview only (3,290K chars total). Download the full file or copy to clipboard to get everything.
Repository: ircmaxell/PHP-PasswordLib
Branch: master
Commit: 692d16877883
Files: 144
Total size: 3.1 MB

Directory structure:
gitextract_ql7hv72k/

├── .gitignore
├── .travis.yml
├── README.markdown
├── build/
│   ├── .gitignore
│   ├── build.properties
│   ├── build.xml
│   ├── phar.stub.php
│   ├── phing/
│   │   ├── document.xml
│   │   ├── package.xml
│   │   ├── quality.xml
│   │   └── test.xml
│   ├── phpcs/
│   │   └── ruleset.xml
│   └── phpmd/
│       └── ruleset.xml
├── composer.json
├── examples/
│   ├── Password/
│   │   └── drupal.php
│   ├── PasswordLib.php
│   └── Random/
│       ├── numbers.php
│       └── strings.php
├── lib/
│   └── PasswordLib/
│       ├── Core/
│       │   ├── AbstractFactory.php
│       │   ├── AutoLoader.php
│       │   ├── BaseConverter.php
│       │   ├── BigMath/
│       │   │   ├── BCMath.php
│       │   │   ├── GMP.php
│       │   │   └── PHPMath.php
│       │   ├── BigMath.php
│       │   ├── Enum.php
│       │   └── Strength.php
│       ├── Hash/
│       │   └── Hash.php
│       ├── Key/
│       │   ├── Derivation/
│       │   │   ├── AbstractDerivation.php
│       │   │   ├── PBKDF/
│       │   │   │   └── PBKDF2.php
│       │   │   └── PBKDF.php
│       │   └── Factory.php
│       ├── Password/
│       │   ├── AbstractPassword.php
│       │   ├── Factory.php
│       │   ├── Implementation/
│       │   │   ├── APR1.php
│       │   │   ├── Blowfish.php
│       │   │   ├── Crypt.php
│       │   │   ├── Drupal.php
│       │   │   ├── Hash.php
│       │   │   ├── Joomla.php
│       │   │   ├── MD5.php
│       │   │   ├── MediaWiki.php
│       │   │   ├── PBKDF.php
│       │   │   ├── PHPASS.php
│       │   │   ├── PHPBB.php
│       │   │   ├── SHA256.php
│       │   │   └── SHA512.php
│       │   └── Password.php
│       ├── PasswordLib.php
│       ├── Random/
│       │   ├── AbstractMixer.php
│       │   ├── Factory.php
│       │   ├── Generator.php
│       │   ├── Mixer/
│       │   │   └── Hash.php
│       │   ├── Mixer.php
│       │   ├── Source/
│       │   │   ├── CAPICOM.php
│       │   │   ├── MTRand.php
│       │   │   ├── MicroTime.php
│       │   │   ├── Rand.php
│       │   │   ├── URandom.php
│       │   │   └── UniqID.php
│       │   └── Source.php
│       └── bootstrap.php
├── phpunit.xml.dist
└── test/
    ├── Data/
    │   └── Vectors/
    │       ├── aes-cbc.test-vectors
    │       ├── aes-cfb.test-vectors
    │       ├── aes-ctr.test-vectors
    │       ├── aes-ecb.test-vectors
    │       ├── aes-ofb.test-vectors
    │       ├── apr1.custom.test-vectors
    │       ├── apr1.test-vectors
    │       ├── blowfish.custom.test-vectors
    │       ├── ccm-RFC3610.test-vectors
    │       ├── ccm-cavs11-dvpt.decryption.test-vectors
    │       ├── cmac-aes.sp-800-38b.test-vectors
    │       ├── des.test-vectors
    │       ├── drupal.custom.test-vectors
    │       ├── hmac.rfc4231.test-vectors
    │       ├── pbkdf.custom.test-vectors
    │       ├── pbkdf2-draft-josefsson-sha1.test-vectors
    │       ├── pbkdf2-draft-josefsson-sha256.test-vectors
    │       ├── phpass.custom.test-vectors
    │       ├── phpbb.custom.test-vectors
    │       ├── rijndael-256-128.unverified.test-vectors
    │       ├── rijndael-256-192.unverified.test-vectors
    │       ├── rijndael-256-256.unverified.test-vectors
    │       ├── triple-des-2-key-128-64.unverified.test-vectors
    │       └── triple-des-3-key-192-64.unverified.test-vectors
    ├── Mocks/
    │   ├── AbstractMock.php
    │   ├── Cipher/
    │   │   ├── Block/
    │   │   │   └── Cipher.php
    │   │   └── Factory.php
    │   ├── Core/
    │   │   ├── Enum.php
    │   │   ├── Factory.php
    │   │   └── Strength.php
    │   ├── Key/
    │   │   └── Derivation/
    │   │       └── PBKDF.php
    │   └── Random/
    │       ├── Generator.php
    │       ├── Mixer.php
    │       └── Source.php
    ├── Unit/
    │   ├── Core/
    │   │   ├── AbstractFactoryTest.php
    │   │   ├── BaseConverterTest.php
    │   │   ├── BigMath/
    │   │   │   ├── BCMathTest.php
    │   │   │   ├── GMPTest.php
    │   │   │   └── PHPMathTest.php
    │   │   ├── BigMathTest.php
    │   │   ├── EnumTest.php
    │   │   └── StrengthTest.php
    │   ├── Hash/
    │   │   └── HashTest.php
    │   ├── Key/
    │   │   ├── Derivation/
    │   │   │   └── PBKDF/
    │   │   │       └── PBKDF2Test.php
    │   │   └── FactoryTest.php
    │   ├── Password/
    │   │   ├── FactoryTest.php
    │   │   └── Implementation/
    │   │       ├── APR1Test.php
    │   │       ├── BlowfishTest.php
    │   │       ├── CryptTest.php
    │   │       ├── DrupalTest.php
    │   │       ├── HashTest.php
    │   │       ├── JoomlaTest.php
    │   │       ├── PBKDFTest.php
    │   │       ├── PHPASSTest.php
    │   │       ├── PHPBBTest.php
    │   │       ├── Password_TestCase.php
    │   │       ├── SHA256Test.php
    │   │       └── SHA512Test.php
    │   ├── PasswordLibTest.php
    │   └── Random/
    │       ├── FactoryTest.php
    │       ├── GeneratorTest.php
    │       ├── Mixer/
    │       │   └── HashTest.php
    │       └── Source/
    │           ├── CAPICOMTest.php
    │           ├── MTRandTest.php
    │           ├── MicroTimeTest.php
    │           ├── RandTest.php
    │           ├── URandomTest.php
    │           └── UniqIDTest.php
    ├── Vectors/
    │   ├── Key/
    │   │   └── Derivation/
    │   │       └── PBKDF/
    │   │           └── PBKDF2Test.php
    │   ├── Password/
    │   │   └── Implementation/
    │   │       ├── APR1Test.php
    │   │       ├── BlowfishTest.php
    │   │       ├── DrupalTest.php
    │   │       ├── PBKDFTest.php
    │   │       ├── PHPASSTest.php
    │   │       └── PHPBBTest.php
    │   └── Random/
    │       └── GeneratorTest.php
    ├── bootstrap.php
    └── lib/
        └── VectorParser/
            ├── CAVS.php
            ├── NESSIE.php
            ├── RFC3610.php
            └── SSV.php

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
vendor

================================================
FILE: .travis.yml
================================================
language: php

php:
  - 5.5
  - 5.4
  - 5.3

before_script:
  - composer install --dev

script: phpunit --configuration phpunit.xml.dist test

================================================
FILE: README.markdown
================================================
# PHP-PasswordLib

## Build Status

[![Build Status](https://travis-ci.org/ircmaxell/PHP-PasswordLib.png?branch=master)](https://travis-ci.org/ircmaxell/PHP-PasswordLib)

## Version

The current version is considered Beta.  This means that it is *ready enough* to test and use, but beware that you should update frequently.

As this software is **BETA**, **Use at your own risk**!

# About

PHP-PasswordLib aims to be an all-inclusive cryptographic library for all cryptographic needs.  It is meant to be easy to install and use, yet extensible and powerful enough for even the most experienced developer.

# Installation

PasswordLib supports multiple installation methods.

## PHAR

From the [downloads](https://github.com/ircmaxell/PHP-PasswordLib/downloads) tab, download the latest phar build.  Then, just require the phar in your code!

    require_once '/path/to/PasswordLib.phar';

## Composer

Add a `composer.json` file to your project with the following:

    {
        "require": {
            "PasswordLib/PasswordLib": "*"
        }
    }

Then, inside that folder, just run `php composer.phar install`.  

Then, in your code, just use the composer autoloader:

    require_once 'vendor/.composer/autoload.php';

That's it!

# Usage

Most use-cases can simply use the root `PasswordLib` class.

    $lib = new PasswordLib\PasswordLib();
    $hash = $lib->createPasswordHash($password);
    $boolean = $lib->verifyPasswordHash($password, $hash);

By default, `createPasswordHash` will create a blowfish hash, which is the most secure available.  To create other types, just pass the prefix of the type as a second parameter.

So, to create a drupal hash:

    $hash = $lib->createPasswordHash($password, '$S$');

Or to create a SHA512 hash:

    $hash = $lib->createPasswordHash($password, '$6$');

It will automatically create a secure salt, and generate the hash.

You can also specify options for the hash. So to use a bcrypt cost of 12,

    $hash = $lib->createPasswordHash($password, '$2a$', array('cost' => 12));

`verifyPasswordHash` will attempt to determine what type of hash is passed in.  So one API call can verify multiple types of hashes.  This allows for applications to be portable and authenticate against multiple databases with one API.

The `PasswordLib` class has other API methods for getting random data.  Two of particular use are `getRandomNumber` and `getRandomToken`.  

 - `getRandomNumber([$min] [, $max]` - gets a secure random integer between the given parameters.

 - `getRandomToken($size)` returns a random string using base64 characters (`a-zA-Z0-9./`).  This is useful for generating nonce's and tokens to send to clients.

The library also contains other methods for generating random data and hashing data, so look around!


## Design Goals

 - **100% Portable**

    That means there are no hard (meaning required) dependencies on extensions or non-standard server configurations.  Certain configurations will have better performance for certain features, but all configurations should be supported.

 - **Well Designed**

    The code will use industry standard design patterns as well as follow guidelines for clean and testable code.

 - **Well Tested**

    That means that the code should be well covered by unit tests.  In addition to unit tests, standard test vectors should be run for custom implementations of algorithms to ensure proper behavior.

 - **Easy To Install**

    PHP-PasswordLib will support three install methods.  The first method is a pear based installer.  The second is a single file PHAR archive.  The third is support via Composer.

 - **Easy To Use**

    One goal of this system is to provide a simple interface which has secure defaults for standard cryptographic needs (Random token generation, password hashing and verifying, etc).  If more power is needed, additional layers of abstraction are available to wire together however is needed.

 - **Easy To Extend**

    The library should be very easy to extend and add new functionality.

# Features

## Optional Autoloading

If you include PasswordLib via a PHAR package, it will automatically autoload all of the classes for you, no extra step necessary.  Simply:

    require 'path/to/PasswordLib.phar';

If you include PasswordLib via a filesystem install, you can use the internal autoloader by either loading the bootstrap.php file, or loading the PasswordLib.php file

    require_once 'path/to/PasswordLib/bootstrap.php

or

    require_once 'path/to/PasswordLib/PasswordLib.php

You can also use any [PSR-0] [3] autoloader.  PasswordLib will automatically detect if an autoloader is setup for its namespace, and will not declare its own if it finds one (it does this by testing if the class PasswordLib\Core\AutoLoader can be found.  If so, that means that an autoloader was declared already.  If not, it loads the core implementation).

    $classLoader = new SplClassLoader('PasswordLib', 'path/to/');
    $classLoader->register();

Note that the path you supply is the directory which contains the *PasswordLib* directory.  Not the PasswordLib directory itself.

## Secure Random Number/String Generation

PHP-PasswordLib implements a method specified in [RFC 4086 - Randomness Requirements for Security] [2].  Basically, it generates randomness from a number of pseudo random sources, and "mixes" them together to get better quality random data out.  When you specify the "strength" of random generator, you are actually telling the system which sources you would like to use.  The higher the strength, the slower and potentially more fragile the source it will use.

The mixing function is also dependent upon the strength required.  For non-cryptographic numbers, a simple XOR mixing function is used (for speed).  As strength requirements increase, it will use a SHA512 based mixing function, then a DES based mixing function and finally an AES-128 based mixing function at "High" strength.

And all of this is hidden behind a simple API.

To generate user-readable strings, you can use the PasswordLib class (which generates medium strength numbers by default):

    $crypt = new PasswordLib\PasswordLib;
    $token = $crypt->getRandomToken(16);

Or you can use the core generator to get more control:

    $factory = new PasswordLib\Random\Factory;
    $generator = $factory->getHighStrengthGenerator();
    $token = $generator->generateString(16);

To generate salts, simple use PasswordLib::getRandomString() or Generator::generate()

## Password Hashing And Validation

A number of password hashing algorithms are supported.  When creating a new hash, the algorithm is chosen via a prefix (a CRYPT() style prefix).  The library will do the rest (salt generation, etc):

    $crypt = new PasswordLib\PasswordLib;
    $hash = $crypt->createPasswordHash($password, '$2a$'); // Blowfish
    $hash = $crypt->createPasswordHash($password, '$S$'); // Drupal

When validating password hashes, where possible, the library will actually auto-detect the algorithm used from the format and verify.  That means it's as simple as:

    $crypt = new PasswordLib\PasswordLib;
    if (!$crypt->verifyPasswordHash($password, $hash)) {
        //Invalid Password!
    }

You can bypass the auto-detection and manually verify:

    $hasher = new PasswordLib\Password\Implementation\Joomla;
    $hash = $hasher->create($password);
    if (!$hasher->verify($password, $hash)) {
        //Invalid Hash!
    }

# Specifications

  - Supported Password Storage Functions
    - **APR1**         - Apache's internal password function
    - **Blowfish**     - BCrypt
    - **Crypt**        - Crypt DES hashing
    - **Drupal**       - Drupal's SHA512 based algorithm
    - **Hash**         - Raw md5, sha1, sha256 and sha512 detected by length
    - **Joomla**       - Joomla's MD5 based algorithm
    - **Crypt MD5**    - Support for Crypt's MD5 algorithm
    - **PBKDF**        - A PBKDF implementation (which supports any supported password based key derivation)
    - **PHPASS**       - An implementation of the portable hash from the PHPASS library
    - **PHPBB**        - PHPBB's MD5 based algorithm
    - **Crypt SHA256** - Crypt's SHA256 algorithm
    - **Crypt SHA512** - Crypt's SHA512 algorithm

 - Supported Random Number Sources
    - **CAPICOM**   - A COM object method call available on Windows systems
    - **MTRand**    - Generation based upon the mt_rand() functions
    - **MicroTime** - A low entropy source based upon the server's microtime
    - **Rand**      - A low entropy source based upon rand()
    - **URandom**   - Generation from the system's /dev/urandom source
    - **UniqID**    - A low entropy source based upon uniqid()

# Library Dependencies:

The only dependency PHP-PasswordLib has to use as a library is the PHP version.  It is made to be completely indepedent of extensions, implementing functionality natively where possible.

## Required

 - PHP >= 5.3.2

## Optional

 - [MCrypt] [1] Support Compiled In


# Build (Testing) Dependencies:

These dependencies are necessary to build the project for your environment (including running unit tests, packaging and code-quality checks)

## Pear Dependencies

 - PDepend Channel (pear.pdepend.org)
   - pdepend/PHP_Depend >= 0.10.0

 - Phing Channel (pear.phing.info)
   - phing/Phing >= 2.4.0

 - PHPMD Channel (pear.phpmd.org)
   - phpmd/PHP_PMD >= 1.1.0


 - PHPUnit Channel (pear.phpunit.de)
   - phpunit/PHPUnit >=3.5.0
   - phpunit/PHP_CodeBrowser >= 1.0.0
   - phpunit/phpcpd >= 1.3.0
   - phpunit/phploc >= 1.6.0

 - PHP-Tools Channel (pear.php-tools.net)
   - pat/vfsStream >= 0.8.0

 - Default Pear Channel
   - pear/PHP_CodeSniffer >= 1.3.0
   - pear/PHP_UML >= 1.5.0

Note: You can install all of them with the following commands:

    pear channel-discover pear.pdepend.org
    pear channel-discover pear.phing.info
    pear channel-discover pear.phpmd.org
    pear channel-discover pear.phpunit.de
    pear channel-discover pear.php-tools.net
    pear channel-discover components.ez.no
    pear channel-discover pear.symfony-project.com

    pear install pdepend/PHP_Depend
    pear install phpmd/PHP_PMD
    pear install pat/vfsStream
    pear install PHP_CodeSniffer
    pear install PHP_UML
    pear install phpunit/PHPUnit
    pear install phpunit/PHP_CodeBrowser
    pear install phpunit/phpcpd
    pear install phpunit/phploc
    pear install phing/Phing


## PHP Dependencies

 - PHP >= 5.3.2
   - `php.ini` Settings:
     - `phar.readonly = Off`

 - PHP Extensions
   - XDebug
   - MCrypt
   - Hash (usually enabled)
   - Phar
   - Zip (For Packaging)
   - BZ2 (For Packaging)
   - XSL (For Documentation)

  [1]: http://us.php.net/manual/en/book.mcrypt.php "MCrypt Book"
  [2]: http://www.ietf.org/rfc/rfc4086.txt "RFC 4086 - Randomness Requirements for Security"
  [3]: http://groups.google.com/group/php-standards/web/psr-0-final-proposal "PSR-0 Autoloading Final Proposal"


Security Vulnerabilities
========================

If you have found a security issue, please contact the author directly at [me@ircmaxell.com](mailto:me@ircmaxell.com).


================================================
FILE: build/.gitignore
================================================
results/


================================================
FILE: build/build.properties
================================================
# Default Paths, DO NOT CHANGE
path.lib=${project.basedir}/lib
path.build=${project.basedir}/build
path.results=${path.build}/results
path.logs=${path.results}/logs
path.tests=${project.basedir}/test
path.docs=${project.basedir}/docs
path.package=${path.results}/package
version.string=0.0.1a1

================================================
FILE: build/build.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project name="PHP-PasswordLib" default="build-lite" basedir="../">
    <property file="build/build.properties" />
	<import file="${path.build}/phing/document.xml" />
	<import file="${path.build}/phing/package.xml" />
	<import file="${path.build}/phing/quality.xml" />
	<import file="${path.build}/phing/test.xml" />

    <target name="clean">
        <delete dir="${path.results}" />
		<mkdir dir="${path.results}" />
        <mkdir dir="${path.results}/logs" />
    </target>

    <target name="build">
		<phingcall target="clean" />
		<phingcall target="test" />
		<phingcall target="quality" />
		<phingcall target="document" />
		<phingcall target="package" />
	</target>

    <target name="build-lite">
		<phingcall target="clean" />
		<phingcall target="test-lite" />
		<phingcall target="quality-lite" />
	</target>

</project>

================================================
FILE: build/phar.stub.php
================================================
<?php
/**
 * Bootstrap the library.  This registers a simple autoloader for autoloading
 * classes
 *
 * If you are using this library inside of another that uses a similar
 * autoloading system, you can use that autoloader instead of this file.
 *
 * PHP version 5.3
 *
 * @category   PHPPasswordLib
 * @package    Core
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright  2011 The Authors
 * @license    http://opensource.org/licenses/bsd-license.php New BSD License
 * @license    http://www.gnu.org/licenses/lgpl-2.1.html LGPL v 2.1
 */

namespace PasswordLib;

\Phar::mapPhar('PasswordLib.phar');
\Phar::interceptFileFuncs();

require_once 'phar://PasswordLib.phar/PasswordLib/Core/AutoLoader.php';

$autoloader = new \PasswordLib\Core\AutoLoader(__NAMESPACE__, 'phar://PasswordLib.phar');

$autoloader->register();

__HALT_COMPILER();


================================================
FILE: build/phing/document.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project name="documentation" default="document" basedir="../../">
    <property file="build/build.properties" />
	
	<target name="document">
		<phingcall target="apidocs" />
		<phingcall target="cb" />
	</target>
	
	<target name="apidocs">
		<delete dir="${path.results}/api" />
		<mkdir dir="${path.results}/api" />
        <exec 
			passthru="true"
			command="phpuml 
						&quot;${path.lib}/PasswordLib&quot; 
						-f htmlnew 
						-n PasswordLib 
						--no-deployment-view 
						-o &quot;${path.results}/api&quot;" 
			/>
    </target>
	
	<target name="cb">
		<delete dir="${path.results}/code-browser" />
		<mkdir dir="${path.results}/code-browser" />
		<mkdir dir="${path.results}/logs" />
        <exec
            command="phpcb 
						--source &quot;${path.lib}&quot; 
						--output &quot;${path.results}/code-browser/&quot; 
						--log &quot;${path.logs}&quot;"
            passthru="true"
            checkreturn="false" />
    </target>
	
</project>

================================================
FILE: build/phing/package.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project name="package" default="package" basedir="../../">
    <property file="build/build.properties" />

     <target name="package">
		 <delete dir="${path.results/lib" />
		 <delete dir="${path.package}" />
		 <mkdir dir="${path.results}/lib" />
		 <mkdir dir="${path.package}" />
		 <exec
            os="Linux"
            outputProperty="version.number"
            command="git rev-parse HEAD"
            dir="${project.basedir}"
            />
		<phingcall target="copyFilesToResultsLib" />
		<phingcall target="packagePear" />
        <phingcall target="packageFiles" />
		<phingcall target="packagePhar" />
    </target>

	<target name="copyFilesToResultsLib">
		<delete dir="${path.results}/lib" />
		<mkdir dir="${path.results}/lib" />

        <copy todir="${path.results}/lib">
            <filterchain>
                <replacetokens begintoken="@@" endtoken="@@">
                    <token key="version" value="${version.number}" />
                </replacetokens>
            </filterchain>
            <fileset dir="${path.lib}">
                <include name="**/**" />
            </fileset>
        </copy>
	</target>

	<target name="packageFiles">
		<zip destfile="${path.package}/PasswordLib.zip">
            <fileset dir="${path.results}/lib">
                <include name="**/**" />
            </fileset>
        </zip>
        <filehash file="${path.package}/PasswordLib.zip" hashtype="0" propertyname="filehash" />
        <echo message="${filehash}" file="${path.package}/PasswordLib.zip.md5" />
        <filehash file="${path.package}/PasswordLib.zip" hashtype="1" propertyname="filehash" />
        <echo message="${filehash}" file="${path.package}/PasswordLib.zip.sha1" />

        <tar destfile="${path.package}/PasswordLib.tar.gz" compression="gzip">
            <fileset dir="${path.results}/lib">
                <include name="**/**" />
            </fileset>
        </tar>
        <tar destfile="${path.package}/PasswordLib.tar.bz2" compression="bzip2">
            <fileset dir="${path.results}/lib">
                <include name="**/**" />
            </fileset>
        </tar>
        <phingcall target="writeFileHashes">
            <property name="filename" value="${path.package}/PasswordLib.tar.gz" />
        </phingcall>
        <phingcall target="writeFileHashes">
            <property name="filename" value="${path.package}/PasswordLib.tar.bz2" />
        </phingcall>
	</target>

	<target name="packagePear">
		<pearpkg name="PasswordLib" dir="${path.results}/lib" destfile="${path.results}/lib/package.xml">
            <fileset dir="${path.results}/lib">
                <include name="**/**" />
            </fileset>
            <option name="notes">Release Notes</option>
            <option name="description">A Cryptography Library for PHP</option>
            <option name="summary">A Cryptography Library for PHP</option>
            <option name="version" value="${version.string}" />
            <option name="state" value="alpha" />
            <mapping name="maintainers">
                <element>
                    <element key="handle" value="ircmaxell" />
                    <element key="name" value="Anthony Ferrara" />
                    <element key="email" value="ircmaxell@ircmaxell.com" />
                    <element key="role" value="lead" />
                </element>
            </mapping>
        </pearpkg>
	</target>

	<target name="packagePhar">
		<pharpackage
            destfile="${path.package}/PasswordLib.phar"
            basedir="${path.results}/lib"
            stub="${path.build}/phar.stub.php"
            signature="sha1"
            >
            <fileset dir="${path.results}/lib">
                <include name="**/**" />
            </fileset>
            <metadata>
                <element name="version" value="${version.number}" />
            </metadata>
        </pharpackage>
        <phingcall target="writeFileHashes">
            <property name="filename" value="${path.package}/PasswordLib.phar" />
        </phingcall>
	</target>

    <target name="writeFileHashes">
        <filehash file="${filename}" hashtype="0" propertyname="filehash" />
        <echo message="${filehash}" file="${filename}.md5" />
        <filehash file="${filename}" hashtype="1" propertyname="filehash" />
        <echo message="${filehash}" file="${filename}.sha1" />
    </target>
</project>


================================================
FILE: build/phing/quality.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project name="quality" default="quality" basedir="../../">
    <property file="build/build.properties" />

	<target name="quality">
		<phingcall target="cs" />
		<phingcall target="cpd" />
		<phingcall target="loc" />
		<phingcall target="pmd" />
		<phingcall target="pdepend" />
	</target>

    <target name="quality-lite">
		<phingcall target="cs" />
		<phingcall target="cpd" />
		<phingcall target="pmd" />
	</target>

	<target name="cs">
		<mkdir dir="${path.results}/logs" />
        <exec
            command="phpcs
						--report=summary
						--report-checkstyle=&quot;${path.logs}/checkstyle.xml&quot;
						--standard=&quot;${path.build}/phpcs/ruleset.xml&quot;
						&quot;${path.lib}/PasswordLib&quot;"
            passthru="true"
            checkreturn="true" />
    </target>

    <target name="cpd">
		<mkdir dir="${path.results}/logs" />
        <phpcpd>
            <fileset dir="${path.lib}">
                <include name="**/*.php" />
            </fileset>
            <formatter type="pmd" outfile="${path.logs}/php-cpd.xml" />
        </phpcpd>
    </target>

    <target name="loc">
		<mkdir dir="${path.results}/logs" />
        <exec
            command="phploc
						--log-csv &quot;${path.logs}/phploc.csv&quot;
						&quot;${path.lib}/PasswordLib&quot;"
	        />
    </target>

    <target name="pmd">
		<mkdir dir="${path.results}/logs" />
        <phpmd rulesets="${path.build}/phpmd/ruleset.xml">
            <fileset dir="${path.lib}/PasswordLib">
                <include name="**/*.php" />
            </fileset>
            <formatter type="xml" outfile="${path.logs}/pmd.xml" />
            <formatter type="text" usefile="false" />
        </phpmd>
    </target>

    <target name="pdepend">
		<mkdir dir="${path.results}/logs" />
        <phpdepend file="${path.lib}/PasswordLib">
            <logger type="phpunit-xml" outfile="${path.logs}/metrics.xml" />
            <logger type="jdepend-xml" outfile="${path.logs}/jdepend.xml" />
            <logger type="jdepend-chart" outfile="${path.logs}/dependencies.svg" />
            <logger type="overview-pyramid" outfile="${path.logs}/overview-pyramid.svg" />
            <analyzer type="coderank-mode" value="method" />
        </phpdepend>
    </target>

</project>

================================================
FILE: build/phing/test.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project name="tests" default="test" basedir="../../">
    <property file="build/build.properties" />

    <target name="test">
        <phingcall target="lint" />
        <phingcall target="unit-all" />
    </target>

    <target name="test-lite">
        <phingcall target="unit" />
    </target>

    <target name="vectors">
        <mkdir dir="${path.results}/logs" />
        <exec
            passthru="true"
            checkreturn="true"
            command="phpunit --log-junit &quot;${path.logs}/vectors.xml&quot;
                       --configuration &quot;${project.basedir}/phpunit.xml.dist&quot;
                       &quot;${path.tests}/Vectors&quot;"
            />
    </target>

    <target name="unit">
        <mkdir dir="${path.results}/logs" />
        <exec
            passthru="true"
            checkreturn="true"
            command="phpunit --log-junit &quot;${path.logs}/junit.xml&quot;
                       --configuration &quot;${project.basedir}/phpunit.xml.dist&quot;
                       &quot;${path.tests}/Unit&quot;"
        />
    </target>

    <target name="unit-all">
        <delete dir="${path.results}/coverage" />
        <mkdir dir="${path.results}/coverage" />
        <mkdir dir="${path.results}/logs" />
        <exec
            passthru="true"
            checkreturn="true"
            command="phpunit --log-junit &quot;${path.logs}/junit.xml&quot;
                       --coverage-clover &quot;${path.logs}/clover.xml&quot;
                       --coverage-html &quot;${path.results}/coverage&quot;
                       --configuration &quot;${project.basedir}/phpunit.xml.dist&quot;"
        />
        <phingcall target="vectors" />
    </target>

    <target name="lint">
        <phplint haltonfailure="true" deprecatedAsError="true">
            <fileset dir="${path.lib}">
                <include name="**/*.php" />
            </fileset>
        </phplint>
    </target>

</project>

================================================
FILE: build/phpcs/ruleset.xml
================================================
<?xml version="1.0"?>
<ruleset name="PHP-PasswordLib">
	<description>PHP-PasswordLib Standard</description>

	<rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop"/>
	<rule ref="Generic.CodeAnalysis.ForLoopWithTestFunctionCall"/>
	<rule ref="Generic.CodeAnalysis.JumbledIncrementer"/>
	<rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/>
	<rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/>
	<rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/>
	<rule ref="Generic.CodeAnalysis.EmptyStatement" />
 
	<rule ref="Generic.Commenting.Todo"/>

	<rule ref="Generic.ControlStructures.InlineControlStructure"/>

	<rule ref="Generic.Files.LineEndings">
		<properties>
			<property name="eolChar" value="\n" />
		</properties>
	</rule>

	<rule ref="Generic.Files.LineLength">
		<properties>
			<property name="lineLimit" value="85" />
			<property name="absoluteLineLimit" value="90" />
		</properties>
	</rule>
 
	<rule ref="Internal.NoCodeFound" />

	<rule ref="Generic.Formatting.DisallowMultipleStatements"/>
	<rule ref="Generic.Formatting.MultipleStatementAlignment"/>
	<rule ref="Generic.Formatting.SpaceAfterCast"/>
	<rule ref="Generic.Functions.CallTimePassByReference" />
	<rule ref="Generic.Functions.FunctionCallArgumentSpacing" />
	<rule ref="Generic.Metrics.NestingLevel" />

	<rule ref="Generic.Functions.OpeningFunctionBraceKernighanRitchie"/>
	<rule ref="PEAR.Functions.ValidDefaultValue"/>

	<rule ref="Generic.NamingConventions.ConstructorName"/>
	<rule ref="Generic.NamingConventions.UpperCaseConstantName"/>
	<rule ref="PEAR.NamingConventions.ValidClassName"/>

	<rule ref="Generic.PHP.DisallowShortOpenTag"/>
	<rule ref="Generic.PHP.DeprecatedFunctions" />
	<rule ref="Generic.PHP.ForbiddenFunctions" />
	<rule ref="Generic.PHP.NoSilencedErrors"/>
	<rule ref="Generic.PHP.LowerCaseConstant"/>
 

	<rule ref="Generic.WhiteSpace.DisallowTabIndent"/>
	<rule ref="Generic.WhiteSpace.ScopeIndent"/>
	<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace"/>

</ruleset>


================================================
FILE: build/phpmd/ruleset.xml
================================================
<?xml version="1.0"?>
<ruleset name="PHP-PasswordLib PHPMD Rule Set"
         xmlns="http://pmd.sf.net/ruleset/1.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0
                     http://pmd.sf.net/ruleset_xml_schema.xsd"
         xsi:noNamespaceSchemaLocation="
                     http://pmd.sf.net/ruleset_xml_schema.xsd">
	<description>
        A custom PHPMD ruleset for detecting messy code in the
        PHP-PasswordLib project.
	</description>

	<rule ref="rulesets/codesize.xml/CyclomaticComplexity">
		<priority>1</priority>
		<properties>
			<property name="reportLevel" value="8" />
		</properties>
	</rule>
	<rule ref="rulesets/codesize.xml/NPathComplexity" />
	<rule ref="rulesets/codesize.xml/ExcessiveClassLength">
		<properties>
			<property name="minimum" value="700" />
		</properties>
	</rule>
	<rule ref="rulesets/codesize.xml/ExcessiveParameterList">
		<properties>
			<property name="minimum" value="6" />
		</properties>
	</rule>
	<rule ref="rulesets/codesize.xml/ExcessivePublicCount">
		<properties>
			<property name="minimum" value="20" />
		</properties>
	</rule>
	<rule ref="rulesets/codesize.xml/TooManyFields" />
	<rule ref="rulesets/codesize.xml/TooManyMethods">
		<properties>
			<property name="maxmethods" value="20" />
		</properties>
	</rule>
	<rule ref="rulesets/codesize.xml/ExcessiveClassComplexity" />
	<rule ref="rulesets/design.xml" />
	<rule ref="rulesets/naming.xml" />
	<rule ref="rulesets/unusedcode.xml">
		<exclude name="UnusedFormalParameter" />
	</rule>
</ruleset>

================================================
FILE: composer.json
================================================
{
    "name": "PasswordLib/PasswordLib",
    "type": "library",
	"version": "1.0.0-beta1",
    "description": "A Password Hashing Library",
    "keywords": ["password", "hash", "hashing", "random", "salt", "crypt"],
    "homepage": "https://github.com/ircmaxell/PHP-PasswordLib",
    "license": "MIT",
    "authors": [
        {
            "name": "Anthony Ferrara",
            "email": "ircmaxell@ircmaxell.com",
            "homepage": "http://blog.ircmaxell.com"
        }
    ],
    "require-dev": {
        "mikey179/vfsStream": "1.1.*"
    },
    "require": {
        "php": ">=5.3.2"
    },
    "autoload": {
        "psr-0": {
            "PasswordLib": "lib"
        }
    }
}


================================================
FILE: examples/Password/drupal.php
================================================
<?php
/**
 * An example file demonstrating the generation and validation of Drupal
 * Passwords (new Style)
 *
 * PHP version 5.3
 *
 * @category   PHPPasswordLib-Examples
 * @package    Password
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright  2011 The Authors
 * @license    http://opensource.org/licenses/bsd-license.php New BSD License
 * @license    http://www.gnu.org/licenses/lgpl-2.1.html LGPL v 2.1
 */

namespace PasswordLibExamples\Password;

//We first load the bootstrap file so we have access to the library
require_once dirname(dirname(__DIR__)) . '/lib/PasswordLib/bootstrap.php';

/**
 * Now, let's create a password that's compatible with Drupal
 */

// First, let's create an instance of Drupal, where 15 is the iteration count for D7
$hasher = new \PasswordLib\Password\Implementation\Drupal(15);

$password = 'FooBarBaz';

// Now, let's create a password hash of the password "FooBarBaz"
$hash = $hasher->create($password);

//It's safe to print, so let's output it:
printf(
    "Password: %s\nHash: %s\n\n",
    $password,
    $hash
);

/**
 * Now, we can also verify any passwords created by Drupal. First, let's load a hash.
 *
 * This works, because it detects the iteration count that's stored in the hash, and
 * pre-configures our instance for us.
 */
$hasher2 = \PasswordLib\Password\Implementation\Drupal::loadFromHash($hash);

/**
 * Next, we verify the hash with the expected password.
 */
$test = $hasher2->verify($password, $hash);

/**
 * $test should now contain a boolean value as to the validity of the hash
 */
printf(
    "Verification was %s\n\n",
    $test ? "Successful!" : "Failed!"
);

================================================
FILE: examples/PasswordLib.php
================================================
<?php
/**
 * An example file demonstrating the use of the wrapper class PasswordLib
 *
 * PHP version 5.3
 *
 * @category   PHPPasswordLib-Examples
 * @package    Core
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright  2011 The Authors
 * @license    http://opensource.org/licenses/bsd-license.php New BSD License
 * @license    http://www.gnu.org/licenses/lgpl-2.1.html LGPL v 2.1
 */

/**
 * Note, you do not need to use namespaces in your code to make use of the library.
 * Namespaces are used here for separation separation only.
 */
namespace PasswordLibExamples;

/**
 * Since we're using the wrapper class, it will automatically instantiate the
 * library without having to manually bootstrap the framework.  Either way will
 * work just fine.  Even if you call both, it's smart enough to not double
 * initialize the framework.
 */
require_once dirname(__DIR__) . '/lib/PasswordLib/PasswordLib.php';

/**
 * There's no parameters to instantiate the class.  Just instantiate it.  Note the
 * namespace prefix.  You can import the class using a `use PasswordLib\PasswordLib`
 * declaration at the top of the file, but this works just as well.
 */
$PasswordLib = new \PasswordLib\PasswordLib;

/**
 * Now we can do all sorts of things with the library.  Let's start off by
 * generating a random token.  This could be a temporary password, a CSRF token, etc
 *
 * Note that the number in the input is the number of desired characters in the
 * random output.  So if you want 16 random characters, pass in 16.  If you want
 * 300, pass in 300.
 *
 * Also note that this generates medium strength random numbers.  If you are using
 * the generated numbers for encryption or for other sensitive needs, use the
 * random generator class itself (see the Random/strings.php example).
 */
$token = $PasswordLib->getRandomToken(16);

printf("\nHere's our token: %s\n", $token);

/**
 * Now, let's generate a random number.  This works just like `rand()` in that you
 * can provide a min and a max to the function to put boundaries on the generated
 * number's range.
 */
$number = $PasswordLib->getRandomNumber();

printf("\nHere's a random number from 0 to PHP_INT_MAX: %d\n", $number);

/**
 * Let's bound that to between 10 and 100...
 */
$number = $PasswordLib->getRandomNumber(10, 100);

printf("\nHere's a random number from 10 to 100: %d\n", $number);

/**
 * And we can also pick a random element from an array
 *
 * This is similar to array_rand, except that it uses a cryptographic secure RNG
 * (which is likely overkill for most applications)
 */
$array = array('ab', 'bc', 'cd', 'de', 'ef', 'fg', 'gh');
$element = $PasswordLib->getRandomArrayElement($array);

printf("\nHere's a random array element: %s\n", $element);

/**
 * And we can randomize an array
 */
$array = array('a', 'b', 'c', 'd', 'e', 'f');
$newArray = $PasswordLib->shuffleArray($array);

printf("\nHere's a randomized array: \n");

print_r($newArray);

printf("\nAnd here's the same arrays with incremental keys:\n");

print_r(array_values($newArray));

/**
 * And we can randomize a string
 */

$string = 'abcdef';
$newString = $PasswordLib->shuffleString($string);

printf("\nHere's our randomized string: %s\n", $newString);

/**
 * Now, lets do some password hashing.
 */
$password = 'Password';

$hash = $PasswordLib->createPasswordHash($password);

printf("\nHere's a hashed password: %s\n", $hash);

/**
 * Let's verify the password.  To show that nothing is saved, let's create a new
 * instance of the PasswordLib class.
 */
$PasswordLib2 = new \PasswordLib\PasswordLib;

$result = $PasswordLib2->verifyPasswordHash($password, $hash);

printf("\nThe result of the password check was: %s\n", $result ? 'successful' : 'not successful');

/**
 * Let's use a different format.  Let's try using Drupal's password hash
 */

$hash = $PasswordLib->createPasswordHash($password, '$S$');

printf("\nHere's a Drupal hashed password: %s\n", $hash);

/**
 * Let's verify the password.  To show that nothing is saved, let's create a new
 * instance of the PasswordLib class.
 */

$result = $PasswordLib2->verifyPasswordHash($password, $hash);

printf("\nThe result of the Drupal password check was: %s\n", $result ? 'successful' : 'not successful');


/**
 * Let's use PBKDF2
 */

$hash = $PasswordLib->createPasswordHash($password, '$pbkdf$');

printf("\nHere's a PBKDF2 hashed password: %s\n", $hash);

/**
 * Let's verify the password.  To show that nothing is saved, let's create a new
 * instance of the PasswordLib class.
 */

$result = $PasswordLib2->verifyPasswordHash($password, $hash);

printf("\nThe result of the PBKDF2 password check was: %s\n", $result ? 'successful' : 'not successful');


/**
 * Let's set the cost of bcrypt off its default:
 */
$result = $PasswordLib->createPasswordHash($password, '$2a$', array('cost' => 4));

printf("\nThe result of BCrypt with reduced cost was: %s\n", $result);

/**
 * Let's set the cost of bcrypt off its default, again:
 */
$result = $PasswordLib->createPasswordHash($password, '$2a$', array('cost' => 5));

printf("\nThe result of BCrypt with reduced cost was: %s\n", $result);

================================================
FILE: examples/Random/numbers.php
================================================
<?php
/**
 * An example file demonstrating the generation of random numbers.
 *
 * PHP version 5.3
 *
 * @category   PHPPasswordLib-Examples
 * @package    Random
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright  2011 The Authors
 * @license    http://opensource.org/licenses/bsd-license.php New BSD License
 * @license    http://www.gnu.org/licenses/lgpl-2.1.html LGPL v 2.1
 */

namespace PasswordLibExamples\Random;


/**
 * Let's generate some random integers!  For this, we'll use the
 * PasswordLib\Random\Factory class to build a random number generator to suit
 * our needs here.
 */

//We first load the bootstrap file so we have access to the library
require_once dirname(dirname(__DIR__)) . '/lib/PasswordLib/bootstrap.php';

//Now, let's get a random number factory
$factory = new \PasswordLib\Random\Factory;

/**
 * Now, since we want a low strength random number, let's get a low strength
 * generator from the factory.
 *
 * If we wanted stronger random numbers, we could change this to medium or high
 * but both use significantly more resources to generate, so let's just stick
 * with low for the purposes of this example:
 */
$generator = $factory->getLowStrengthGenerator();

/**
 * Now, let's start generating our random numbers!  To start off with, let's
 * pick a few random number between 1 and 10
 */
$numbers = array();
for ($i = 0; $i < 5; $i++) {
    $numbers[] = $generator->generateInt(1, 10);
}
vprintf("\nRandom Numbers between 1 and 10: %d, %d, %d, %d, %d \n", $numbers);

/**
 * Now, since we have that down, let's have some fun:
 */
printf("\nA negative random number: %d\n", $generator->generateInt(-100, 0));

printf("\nA really big random number: %d\n", $generator->generateInt(1234567, 12345678));

printf("\nA not-so-random number: %d\n", $generator->generateInt(42, 42));

/**
 * And that's all there is to it!
 */


================================================
FILE: examples/Random/strings.php
================================================
<?php
/**
 * An example file demonstrating the generation of random strings.
 *
 * PHP version 5.3
 *
 * @category   PHPPasswordLib-Examples
 * @package    Random
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright  2011 The Authors
 * @license    http://opensource.org/licenses/bsd-license.php New BSD License
 * @license    http://www.gnu.org/licenses/lgpl-2.1.html LGPL v 2.1
 */

namespace PasswordLibExamples\Random;

/**
 * Let's generate some random strings!  For this, we'll use the
 * PasswordLib\Random\Factory class to build a random number generator to suit
 * our needs here.
 */

//We first load the bootstrap file so we have access to the library
require_once dirname(dirname(__DIR__)) . '/lib/PasswordLib/bootstrap.php';

//Now, let's get a random number factory
$factory = new \PasswordLib\Random\Factory;

/**
 * Now, since we want a low strength random number, let's get a low strength
 * generator from the factory.
 *
 * If we wanted stronger random numbers, we could change this to medium or high
 * but both use significantly more resources to generate, so let's just stick
 * with low for the purposes of this example:
 */
$generator = $factory->getLowStrengthGenerator();

/**
 * We can now start generating our random strings.  The generator by default
 * outputs full-byte strings (character 0 - 255), so it's not safe to display
 * them directly.  Instead, let's convert them to hex to show the string.
 */
$number = $generator->generate(8);

printf("\nHere's our first random string: %s\n", bin2hex($number));

/**
 * We can also base64 encode it to display the string
 */
$number = $generator->generate(8);

printf("\nHere's a base64 encoded random string: %s\n", base64_encode($number));

/**
 * But, we can also generate random strings against a list of characters.  That
 * way we can use the random string in user-facing situations:  (this can be for
 * one-time-use passwords, CRSF tokens, etc).
 *
 * Now, let's define a string of allowable characters to use for token
 * generation.
 */
$characters = '0123456789abcdefghijklmnopqrstuvwxyz' .
              'ABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%&;<>?';

/**
 * After that, we can generate the random string
 */

$string = $generator->generateString(16, $characters);

printf("\nHere's our token: %s\n", $string);


================================================
FILE: lib/PasswordLib/Core/AbstractFactory.php
================================================
<?php
/**
 * The base abstract factory used by all PasswordLib factories
 *
 * PHP version 5.3
 *
 * @category  PHPPasswordLib
 * @package   Core
 * @author    Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright 2011 The Authors
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 * @version   Build @@version@@
 */

namespace PasswordLib\Core;

/**
 * The base abstract factory used by all PasswordLib factories
 *
 * @category PHPPasswordLib
 * @package  Core
 * @author   Anthony Ferrara <ircmaxell@ircmaxell.com>
 */
abstract class AbstractFactory {

    /**
     * Register a type with the factory by name
     *
     * This is an internal method to check if a provided class name implements
     * an interface, and if it does to append that class to an internal array
     * by name.
     *
     * @param string  $type        The name of the variable to store the class
     * @param string  $implements  The interface to validate against
     * @param string  $name        The name of this particular class
     * @param string  $class       The fully qualified class name
     * @param boolean $instantiate Should the class be stored instantiated
     *
     * @return void
     * @throws InvalidArgumentException If class does not implement interface
     */
    protected function registerType(
        $type,
        $implements,
        $name,
        $class,
        $instantiate = false
    ) {
        $name = strtolower($name);
        $refl = new \ReflectionClass($class);
        if (!$refl->implementsInterface($implements)) {
            $message = sprintf('Class must implement %s', $implements);
            throw new \InvalidArgumentException($message);
        }
        if ($instantiate) {
            $class = new $class;
        }

        $this->{$type}[$name] = $class;
    }

    /**
     * Load a set of classes from a directory into the factory
     *
     * @param string $directory The directory to search for classes in
     * @param string $namespace The namespace prefix for any found classes
     * @param string $callback  The callback with which to register the class
     *
     * @return void
     */
    protected function loadFiles($directory, $namespace, $callback) {
        foreach (new \DirectoryIterator($directory) as $file) {
            $filename = $file->getBasename();
            if ($file->isFile() && substr($filename, -4) == '.php') {
                $name  = substr($filename, 0, -4);
                $class = $namespace . $name;
                call_user_func($callback, $name, $class);
            }
        }
    }

}


================================================
FILE: lib/PasswordLib/Core/AutoLoader.php
================================================
<?php
/**
 * An implementation of the PSR-0 Autoloader.  This can be replaced at will with
 * other implementations if necessary.
 *
 * PHP version 5.3
 *
 * @category   PHPPasswordLib
 * @package    Core
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright  2011 The Authors
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 * @version    Build @@version@@
 */

namespace PasswordLib\Core;

/**
 * An implementation of the PSR-0 Autoloader.  This can be replaced at will with
 * other implementations if necessary.
 *
 * @category   PHPPasswordLib
 * @package    Core
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 */
class AutoLoader {

    /**
     * @var string The namespace prefix for this instance.
     */
    protected $namespace = '';

    /**
     * @var string The filesystem prefix to use for this instance
     */
    protected $path = '';

    /**
     * Build the instance of the autoloader
     *
     * @param string $namespace The prefixed namespace this instance will load
     * @param string $path      The filesystem path to the root of the namespace
     *
     * @return void
     */
    public function __construct($namespace, $path) {
        $this->namespace = ltrim($namespace, '\\');
        $this->path      = rtrim($path, '/\\') . DIRECTORY_SEPARATOR;
    }

    /**
     * Try to load a class
     *
     * @param string $class The class name to load
     *
     * @return boolean If the loading was successful
     */
    public function load($class) {
        $class = ltrim($class, '\\');
        if (strpos($class, $this->namespace) === 0) {
            $nsparts   = explode('\\', $class);
            $class     = array_pop($nsparts);
            $nsparts[] = '';
            $path      = $this->path . implode(DIRECTORY_SEPARATOR, $nsparts);
            $path     .= str_replace('_', DIRECTORY_SEPARATOR, $class) . '.php';
            if (file_exists($path)) {
                require $path;
                return true;
            }
        }
        return false;
    }

    /**
     * Register the autoloader to PHP
     *
     * @return boolean The status of the registration
     */
    public function register() {
        return spl_autoload_register(array($this, 'load'));
    }

    /**
     * Unregister the autoloader to PHP
     *
     * @return boolean The status of the unregistration
     */
    public function unregister() {
        return spl_autoload_unregister(array($this, 'load'));
    }

}

================================================
FILE: lib/PasswordLib/Core/BaseConverter.php
================================================
<?php

/**
 * A Utility class for converting between raw binary strings and a given
 * list of characters
 *
 * PHP version 5.3
 *
 * @category   PHPPasswordLib
 * @package    Core
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright  2011 The Authors
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 * @version    Build @@version@@
 */

namespace PasswordLib\Core;

/**
 * A Utility class for converting between raw binary strings and a given
 * list of characters
 *
 * @category   PHPPasswordLib
 * @package    Core
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 */
class BaseConverter {

    /**
     * Convert from a raw binary string to a string of characters
     *
     * @param string $string     The string to convert from
     * @param string $characters The list of characters to convert to
     *
     * @return string The converted string
     */
    public static function convertFromBinary($string, $characters) {
        if ($string === '' || empty($characters)) {
            return '';
        }
        $string   = str_split($string);
        $callback = function($str) {
                return ord($str);
            };
        $string    = array_map($callback, $string);
        $converted = static::baseConvert($string, 256, strlen($characters));
        $callback  = function ($num) use ($characters) {
                return $characters[$num];
            };
        $ret = implode('', array_map($callback, $converted));
        return $ret;
    }

    /**
     * Convert to a raw binary string from a string of characters
     *
     * @param string $string     The string to convert from
     * @param string $characters The list of characters to convert to
     *
     * @return string The converted string
     */
    public static function convertToBinary($string, $characters) {
        if (empty($string) || empty($characters)) {
            return '';
        }
        $string   = str_split($string);
        $callback = function($str) use ($characters) {
                return strpos($characters, $str);
            };
        $string    = array_map($callback, $string);
        $converted = static::baseConvert($string, strlen($characters), 256);
        $callback  = function ($num) {
                return chr($num);
            };
        return implode('', array_map($callback, $converted));
    }

    /**
     * Convert an array of input blocks to another numeric base
     *
     * This function was modified from an implementation found on StackOverflow.
     * Special Thanks to @KeithRandall for supplying the implementation.
     *
     * @param int[] $source  The source number, as an array
     * @param int   $srcBase The source base as an integer
     * @param int   $dstBase The destination base as an integer
     *
     * @see http://codegolf.stackexchange.com/questions/1620/arb/1626#1626
     * @return int[] An array of integers in the encoded base
     */
    public static function baseConvert(array $source, $srcBase, $dstBase) {
        if ($dstBase < 2) {
            $message = sprintf('Invalid Destination Base: %d', $dstBase);
            throw new \InvalidArgumentException($message);
        }
        $result = array();
        $count  = count($source);
        while ($count) {
            $itMax     = $count;
            $remainder = $count = $loop = 0;
            while($loop < $itMax) {
                $dividend  = $source[$loop++] + $remainder * $srcBase;
                $remainder = $dividend % $dstBase;
                $res       = ($dividend - $remainder) / $dstBase;
                if ($count || $res) {
                    $source[$count++] = $res;
                }
            }
            $result[] = $remainder;
        }
        return array_reverse($result);
    }

}


================================================
FILE: lib/PasswordLib/Core/BigMath/BCMath.php
================================================
<?php
/**
 * A class for arbitrary precision math functions implemented using bcmath
 *
 * PHP version 5.3
 *
 * @category   PHPPasswordLib
 * @package    Core
 * @subpackage BigMath
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright  2011 The Authors
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 * @version    Build @@version@@
 */
namespace PasswordLib\Core\BigMath;

/**
 * A class for arbitrary precision math functions implemented using bcmath
 *
 * @category   PHPPasswordLib
 * @package    Core
 * @subpackage BigMath
 */
class BCMath extends \PasswordLib\Core\BigMath {

    /**
     * Add two numbers together
     * 
     * @param string $left  The left argument
     * @param string $right The right argument
     * 
     * @return A base-10 string of the sum of the two arguments
     */
    public function add($left, $right) {
        return bcadd($left, $right, 0);
    }

    /**
     * Subtract two numbers
     * 
     * @param string $left  The left argument
     * @param string $right The right argument
     * 
     * @return A base-10 string of the difference of the two arguments
     */
    public function subtract($left, $right) {
        return bcsub($left, $right);
    }

}

================================================
FILE: lib/PasswordLib/Core/BigMath/GMP.php
================================================
<?php
/**
 * A class for arbitrary precision math functions implemented using GMP
 *
 * PHP version 5.3
 *
 * @category   PHPPasswordLib
 * @package    Core
 * @subpackage BigMath
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright  2011 The Authors
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 * @version    Build @@version@@
 */
namespace PasswordLib\Core\BigMath;

/**
 * A class for arbitrary precision math functions implemented using GMP
 *
 * @category   PHPPasswordLib
 * @package    Core
 * @subpackage BigMath
 */
class GMP extends \PasswordLib\Core\BigMath {

    /**
     * Add two numbers together
     * 
     * @param string $left  The left argument
     * @param string $right The right argument
     * 
     * @return A base-10 string of the sum of the two arguments
     */
    public function add($left, $right) {
        return gmp_strval(gmp_add($left, $right));
    }

    /**
     * Subtract two numbers
     * 
     * @param string $left  The left argument
     * @param string $right The right argument
     * 
     * @return A base-10 string of the difference of the two arguments
     */
    public function subtract($left, $right) {
        return gmp_strval(gmp_sub($left, $right));
    }

}

================================================
FILE: lib/PasswordLib/Core/BigMath/PHPMath.php
================================================
<?php
/**
 * A class for arbitrary precision math functions implemented in PHP
 *
 * PHP version 5.3
 *
 * @category   PHPPasswordLib
 * @package    Core
 * @subpackage BigMath
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright  2011 The Authors
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 * @version    Build @@version@@
 */
namespace PasswordLib\Core\BigMath;

use PasswordLib\Core\BaseConverter;

/**
 * A class for arbitrary precision math functions implemented in PHP
 *
 * @category   PHPPasswordLib
 * @package    Core
 * @subpackage BigMath
 */
class PHPMath extends \PasswordLib\Core\BigMath {

    /**
     * Add two numbers together
     *
     * @param string $left  The left argument
     * @param string $right The right argument
     *
     * @return A base-10 string of the sum of the two arguments
     */
    public function add($left, $right) {
        if (empty($left)) {
            return $right;
        } elseif (empty($right)) {
            return $left;
        }
        $negative = '';
        if ($left[0] == '-' && $right[0] == '-') {
            $negative = '-';
            $left     = substr($left, 1);
            $right    = substr($right, 1);
        } elseif ($left[0] == '-') {
            return $this->subtract($right, substr($left, 1));
        } elseif ($right[0] == '-') {
            return $this->subtract($left, substr($right, 1));
        }
        $left   = $this->normalize($left);
        $right  = $this->normalize($right);
        $result = BaseConverter::convertFromBinary(
            $this->addBinary($left, $right),
            '0123456789'
        );
        return $negative . $result;
    }

    /**
     * Subtract two numbers
     *
     * @param string $left  The left argument
     * @param string $right The right argument
     *
     * @return A base-10 string of the difference of the two arguments
     */
    public function subtract($left, $right) {
        if (empty($left)) {
            return $right;
        } elseif (empty($right)) {
            return $left;
        } elseif ($right[0] == '-') {
            return $this->add($left, substr($right, 1));
        } elseif ($left[0] == '-') {
            return '-' . $this->add(ltrim($left, '-'), $right);
        }
        $left    = $this->normalize($left);
        $right   = $this->normalize($right);
        $results = $this->subtractBinary($left, $right);
        $result  = BaseConverter::convertFromBinary($results[1], '0123456789');
        return $results[0] . $result;
    }

    /**
     * Add two binary strings together
     *
     * @param string $left  The left argument
     * @param string $right The right argument
     *
     * @return string The binary result
     */
    protected function addBinary($left, $right) {
        $len    = max(strlen($left), strlen($right));
        $left   = str_pad($left, $len, chr(0), STR_PAD_LEFT);
        $right  = str_pad($right, $len, chr(0), STR_PAD_LEFT);
        $result = '';
        $carry  = 0;
        for ($i = 0; $i < $len; $i++) {
            $sum     = ord($left[$len - $i - 1])
                 + ord($right[$len - $i - 1])
                 + $carry;
            $result .= chr($sum % 256);
            $carry   = $sum >> 8;
        }
        while ($carry) {
            $result .= chr($carry % 256);
            $carry >>= 8;
        }
        return strrev($result);
    }

    /**
     * Subtract two binary strings using 256's compliment
     *
     * @param string $left  The left argument
     * @param string $right The right argument
     *
     * @return string The binary result
     */
    protected function subtractBinary($left, $right) {
        $len    = max(strlen($left), strlen($right));
        $left   = str_pad($left, $len, chr(0), STR_PAD_LEFT);
        $right  = str_pad($right, $len, chr(0), STR_PAD_LEFT);
        $right  = $this->compliment($right);
        $result = $this->addBinary($left, $right);
        if (strlen($result) > $len) {
            // Positive Result
            $carry  = substr($result, 0, -1 * $len);
            $result = substr($result, strlen($carry));
            return array(
                '',
                $this->addBinary($result, $carry)
            );
        }
        return array('-', $this->compliment($result));
    }

    /**
     * Take the 256 base compliment
     *
     * @param string $string The binary string to compliment
     *
     * @return string The complimented string
     */
    protected function compliment($string) {
        $result = '';
        $len    = strlen($string);
        for ($i = 0; $i < $len; $i++) {
            $result .= chr(255 - ord($string[$i]));
        }
        return $result;
    }

    /**
     * Transform a string number into a binary string using base autodetection
     *
     * @param string $string The string to transform
     *
     * @return string The binary transformed number
     */
    protected function normalize($string) {
        return BaseConverter::convertToBinary(
            $string,
            '0123456789'
        );
    }

}

================================================
FILE: lib/PasswordLib/Core/BigMath.php
================================================
<?php
/**
 * A class for arbitrary precision math functions
 *
 * PHP version 5.3
 *
 * @category   PHPPasswordLib
 * @package    Core
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright  2011 The Authors
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 * @version    Build @@version@@
 */
namespace PasswordLib\Core;

/**
 * A class for arbitrary precision math functions
 *
 * @category   PHPPasswordLib
 * @package    Core
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 */
abstract class BigMath {

    /**
     * Get an instance of the big math class
     *
     * This is NOT a singleton.  It simply loads the proper strategy
     * given the current server configuration
     *
     * @return \PasswordLib\Core\BigMath A big math instance
     */
    public static function createFromServerConfiguration() {
        //@codeCoverageIgnoreStart
        if (extension_loaded('gmp')) {
            return new \PasswordLib\Core\BigMath\GMP();
        } elseif (extension_loaded('bcmath')) {
            return new \PasswordLib\Core\BigMath\BCMath();
        } else {
            return new \PasswordLib\Core\BigMath\PHPMath();
        }
        //@codeCoverageIgnoreEnd
    }

    /**
     * Add two numbers together
     *
     * @param string $left  The left argument
     * @param string $right The right argument
     *
     * @return A base-10 string of the sum of the two arguments
     */
    abstract public function add($left, $right);

    /**
     * Subtract two numbers
     *
     * @param string $left  The left argument
     * @param string $right The right argument
     *
     * @return A base-10 string of the difference of the two arguments
     */
    abstract public function subtract($left, $right);

}

================================================
FILE: lib/PasswordLib/Core/Enum.php
================================================
<?php
/**
 * The Enum base class for Enum functionality
 *
 * PHP version 5.3
 *
 * @category   PHPPasswordLib
 * @package    Core
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright  2011 The Authors
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 * @version    Build @@version@@
 */
namespace PasswordLib\Core;

use \ReflectionObject;

/**
 * The Enum base class for Enum functionality
 *
 * This is based off of the SplEnum class implementation (which is only available
 * as a PECL extension in 5.3)
 *
 * @see        http://www.php.net/manual/en/class.splenum.php
 * @category   PHPPasswordLib
 * @package    Core
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 */
abstract class Enum {

    /**
     * A default value of null is provided.  Override this to set your own default
     */
    const __DEFAULT = null;

    /**
     * @var string The name of the constant this instance is using
     */
    protected $name = '';

    /**
     * @var scalar The value of the constant this instance is using.
     */
    protected $value = '';

    /**
     * Creates a new value of the Enum type
     *
     * @param mixed   $value  The value this instance represents
     * @param boolean $strict Not Implemented at this time
     *
     * @return void
     * @throws UnexpectedValueException If the value is not a constant
     */
    public function __construct($value = null, $strict = false) {
        if (is_null($value)) {
            $value = static::__DEFAULT;
        }
        $validValues = $this->getConstList();
        $this->name  = array_search($value, $validValues);
        if (!$this->name) {
            throw new \UnexpectedValueException(
                'Value not a const in enum ' . get_class($this)
            );
        }
        $this->value = $value;
    }

    /**
     * Cast the current object to a string and return its value
     *
     * @return mixed the current value of the instance
     */
    public function __toString() {
        return (string) $this->value;
    }

    /**
     * Compare two enums using numeric comparison
     *
     * @param Enum $arg The enum to compare this instance to
     *
     * @return int 0 if same, 1 if the argument is greater, -1 else
     */
    public function compare(Enum $arg) {
        if ($this->value == $arg->value) {
            return 0;
        } elseif ($this->value > $arg->value) {
            return -1;
        } else {
            return 1;
        }
    }

    /**
     * Returns all constants (including values) as an associative array
     *
     * @param boolean $include_default Include the __default magic value?
     *
     * @return array All of the constants found against this instance
     */
    public function getConstList($include_default = false) {
        static $constCache = array();
        $class             = get_class($this);
        if (!isset($constCache[$class])) {
            $reflector          = new ReflectionObject($this);
            $constCache[$class] = $reflector->getConstants();
        }
        if (!$include_default) {
            $constants = $constCache[$class];
            unset($constants['__DEFAULT']);
            return $constants;
        }
        return $constCache[$class];
    }

}

================================================
FILE: lib/PasswordLib/Core/Strength.php
================================================
<?php
/**
 * The strength FlyweightEnum class
 *
 * PHP version 5.3
 *
 * @category   PHPPasswordLib
 * @package    Core
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright  2011 The Authors
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 * @version    Build @@version@@
 */

namespace PasswordLib\Core;

/**
 * The strength FlyweightEnum class
 *
 * All mixing strategies must extend this class
 *
 * @category   PHPPasswordLib
 * @package    Core
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 */
class Strength extends Enum {

    /**
     * We provide a default value of VeryLow so that we don't accidentally over
     * state the strength if we forget to pass in a value...
     */
    const __DEFAULT = self::VERYLOW;

    /**
     * This represents Non-Cryptographic strengths.  It should not be used any time
     * that security or confidentiality is at stake
     */
    const VERYLOW = 1;

    /**
     * This represents the bottom line of Cryptographic strengths.  It may be used
     * for low security uses where some strength is required.
     */
    const LOW = 3;

    /**
     * This is the general purpose Cryptographical strength.  It should be suitable
     * for all uses except the most sensitive.
     */
    const MEDIUM = 5;

    /**
     * This is the highest strength available.  It should not be used unless the
     * high strength is needed, due to hardware constraints (and entropy
     * limitations).
     */
    const HIGH = 7;

}


================================================
FILE: lib/PasswordLib/Hash/Hash.php
================================================
<?php
/**
 * A hash utility data mapper class
 * 
 * This class's purpose is to store information about hash algorithms that is
 * otherwise unavailable during runtime.  Some information is available (such 
 * as the output size), but is included anyway for performance and completeness
 * reasons.
 *
 * PHP version 5.3
 *
 * @category   PHPPasswordLib
 * @package    Hash
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright  2011 The Authors
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 * @version    Build @@version@@
 */
namespace PasswordLib\Hash;

/**
 * A hash utility data mapper class
 * 
 * This class's purpose is to store information about hash algorithms that is
 * otherwise unavailable during runtime.  Some information is available (such 
 * as the output size), but is included anyway for performance and completeness
 * reasons.
 *
 * PHP version 5.3
 *
 * @category   PHPPasswordLib
 * @package    Hash
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 */
class Hash {

    /**
     * This array contains information about each hash function available to PHP
     * at the present time.  Block sizes are not available from functions, so they
     * must be hard coded.
     * 
     * The "secure" indicates the strength of the hash and whether or not any known
     * cryptographic attacks exist for the hash function. This will only apply when
     * using the hash functions for situations that require cryptographic strength
     * such as message signing.  For other uses the insecure ones can have valid
     * uses.
     * 
     * @var array An array of information about each supported hash function 
     */
    protected static $hashInfo = array(
        'md2' => array(
            'HashSize'  => 128,
            'BlockSize' => 128,
            'secure'    => false,
        ),
        'md4' => array(
            'HashSize'  => 128,
            'BlockSize' => 512,
            'secure'    => false,
        ),
        'md5' => array(
            'HashSize'  => 128,
            'BlockSize' => 512,
            'secure'    => false,
        ),
        'sha1' => array(
            'HashSize'  => 160,
            'BlockSize' => 512,
            'secure'    => false,
        ),
        'sha224' => array(
            'HashSize'  => 224,
            'BlockSize' => 512,
            'secure'    => true,
        ),
        'sha256' => array(
            'HashSize'  => 256,
            'BlockSize' => 512,
            'secure'    => true,
        ),
        'sha384' => array(
            'HashSize'  => 384,
            'BlockSize' => 1024,
            'secure'    => true,
        ),
        'sha512' => array(
            'HashSize'  => 512,
            'BlockSize' => 1024,
            'secure'    => true,
        ),
        'ripemd128' => array(
            'HashSize'  => 128,
            'BlockSize' => 512,
            'secure'    => true,
        ),
        'ripemd160' => array(
            'HashSize'  => 160,
            'BlockSize' => 512,
            'secure'    => true,
        ),
        'ripemd256' => array(
            'HashSize'  => 256,
            'BlockSize' => 512,
            'secure'    => true,
        ),
        'ripemd320' => array(
            'HashSize'  => 320,
            'BlockSize' => 512,
            'secure'    => true,
        ),
        'whirlpool' => array(
            'HashSize'  => 512,
            'BlockSize' => 512,
            'secure'    => true,
        ),
        'tiger128,3' => array(
            'HashSize'  => 128,
            'BlockSize' => 512,
            'secure'    => true,
        ),
        'tiger160,3' => array(
            'HashSize'  => 160,
            'BlockSize' => 512,
            'secure'    => true,
        ),
        'tiger192,3' => array(
            'HashSize'  => 192,
            'BlockSize' => 512,
            'secure'    => true,
        ),
        'tiger128,4' => array(
            'HashSize'  => 128,
            'BlockSize' => 512,
            'secure'    => true,
        ),
        'tiger160,4' => array(
            'HashSize'  => 160,
            'BlockSize' => 512,
            'secure'    => true,
        ),
        'tiger192,4' => array(
            'HashSize'  => 192,
            'BlockSize' => 512,
            'secure'    => true,
        ),
        'snefru' => array(
            'HashSize'  => 256,
            'BlockSize' => 512,
            'secure'    => false,
        ),
        'snefru256' => array(
            'HashSize'  => 256,
            'BlockSize' => 512,
            'secure'    => false,
        ),
        'gost' => array(
            'HashSize'  => 256,
            'BlockSize' => 256,
            'secure'    => false,
        ),
        'adler32' => array(
            'HashSize'  => 32,
            'BlockSize' => 16,
            'secure'    => false,
        ),
        'crc32' => array(
            'HashSize'  => 32,
            'BlockSize' => 32,
            'secure'    => false,
        ),
        'crc32b' => array(
            'HashSize'  => 32,
            'BlockSize' => 32,
            'secure'    => false,
        ),
        'salsa10' => array(
            'HashSize'  => 512,
            'BlockSize' => 512,
            'secure'    => true,
        ),
        'salsa20' => array(
            'HashSize'  => 512,
            'BlockSize' => 512,
            'secure'    => true,
        ),
        'haval128,3' => array(
            'HashSize'  => 128,
            'BlockSize' => 1024,
            'secure'    => false,
        ),
        'haval160,3' => array(
            'HashSize'  => 160,
            'BlockSize' => 1024,
            'secure'    => false,
        ),
        'haval192,3' => array(
            'HashSize'  => 192,
            'BlockSize' => 1024,
            'secure'    => false,
        ),
        'haval224,3' => array(
            'HashSize'  => 224,
            'BlockSize' => 1024,
            'secure'    => false,
        ),
        'haval256,3' => array(
            'HashSize'  => 256,
            'BlockSize' => 1024,
            'secure'    => false,
        ),
        'haval128,4' => array(
            'HashSize'  => 128,
            'BlockSize' => 1024,
            'secure'    => false,
        ),
        'haval160,4' => array(
            'HashSize'  => 160,
            'BlockSize' => 1024,
            'secure'    => false,
        ),
        'haval192,4' => array(
            'HashSize'  => 192,
            'BlockSize' => 1024,
            'secure'    => false,
        ),
        'haval224,4' => array(
            'HashSize'  => 224,
            'BlockSize' => 1024,
            'secure'    => false,
        ),
        'haval256,4' => array(
            'HashSize'  => 256,
            'BlockSize' => 1024,
            'secure'    => false,
        ),
        'haval128,5' => array(
            'HashSize'  => 128,
            'BlockSize' => 1024,
            'secure'    => false,
        ),
        'haval160,5' => array(
            'HashSize'  => 160,
            'BlockSize' => 1024,
            'secure'    => false,
        ),
        'haval192,5' => array(
            'HashSize'  => 192,
            'BlockSize' => 1024,
            'secure'    => false,
        ),
        'haval224,5' => array(
            'HashSize'  => 224,
            'BlockSize' => 1024,
            'secure'    => false,
        ),
        'haval256,5' => array(
            'HashSize'  => 256,
            'BlockSize' => 1024,
            'secure'    => false,
        ),
        'joaat' => array(
            'HashSize'  => 32,
            'BlockSize' => 64,
            'secure'    => false,
        ),
        'fnv132' => array(
            'HashSize'  => 32,
            'BlockSize' => 32,
            'secure'    => false,
        ),
        'fnv164' => array(
            'HashSize'  => 64,
            'BlockSize' => 64,
            'secure'    => false,
        ),
    );

    /**
     * Get the block size of the specified function in bytes
     *
     * @param string $hash The hash function to look up
     * 
     * @return int The number of bytes in the block function
     */
    public static function getBlockSize($hash) {
        return static::getBlockSizeInBits($hash) / 8;
    }

    /**
     * Get the block size of the specified function in bits
     *
     * @param string $hash The hash function to look up
     * 
     * @return int The number of bits in the block function
     */
    public static function getBlockSizeInBits($hash) {
        if (isset(static::$hashInfo[$hash]['BlockSize'])) {
            return static::$hashInfo[$hash]['BlockSize'];
        }
        return 0;
    }

    /**
     * Get the output size of the specified function in bytes
     *
     * @param string $hash The hash function to look up
     * 
     * @return int The number of bytes outputted by the hash function
     */
    public static function getHashSize($hash) {
        return static::getHashSizeInBits($hash) / 8;
    }

    /**
     * Get the output size of the specified function in bits
     *
     * @param string $hash The hash function to look up
     * 
     * @return int The number of bits outputted by the hash function
     */
    public static function getHashSizeInBits($hash) {
        if (isset(static::$hashInfo[$hash]['HashSize'])) {
            return static::$hashInfo[$hash]['HashSize'];
        }
        return 0;
    }

    /**
     * Check to see if the hash function specified is available
     *
     * @param string $hash The hash function to look up
     * 
     * @return boolean If the hash function is available in this version of PHP
     */
    public static function isAvailable($hash) {
        return in_array($hash, hash_algos());
    }

    /**
     * Check to see if the specified hash function is secure enough for 
     * cryptographic uses
     * 
     * The "secure" indicates the strength of the hash and whether or not any known
     * cryptographic attacks exist for the hash function. This will only apply when
     * using the hash functions for situations that require cryptographic strength
     * such as message signing.  For other uses the insecure ones can have valid
     * uses.
     * 
     * @param string $hash The hash function to look up
     * 
     * @return bolean If the function is secure
     */
    public static function isSecure($hash) {
        if (isset(static::$hashInfo[$hash])) {
            return static::$hashInfo[$hash]['secure'];
        }
        return false;
    }

}

================================================
FILE: lib/PasswordLib/Key/Derivation/AbstractDerivation.php
================================================
<?php
/**
 * An abstract implementation of some standard key derivation needs
 *
 * PHP version 5.3
 *
 * @category   PHPPasswordLib
 * @package    Key
 * @subpackage Derivation
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright  2011 The Authors
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 * @version    Build @@version@@
 */

namespace PasswordLib\Key\Derivation;

/**
 * An abstract implementation of some standard key derivation needs
 *
 * @category   PHPPasswordLib
 * @package    Key
 * @subpackage Derivation
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 */
abstract class AbstractDerivation {

    /**
     * @var Hash A hashing algorithm to use for the derivation
     */
    protected $hash = null;

    /**
     * @var array An array of options for the key derivation function
     */
    protected $options = array(
        'hash'        => 'sha512',
    );

    /**
     * Construct the derivation instance
     *
     * @param array $options An array of options to set for this instance
     *
     * @return void
     */
    public function __construct(array $options = array()) {
        $this->options = $options + $this->options;
        $this->hash    = $this->options['hash'];
    }

}


================================================
FILE: lib/PasswordLib/Key/Derivation/PBKDF/PBKDF2.php
================================================
<?php
/**
 * An implementation of the RFC 2898 PBKDF2 Standard key derivation function
 *
 * PHP version 5.3
 *
 * @see        http://www.ietf.org/rfc/rfc2898.txt
 * @category   PHPPasswordLib
 * @package    Key
 * @subpackage Derivation
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright  2011 The Authors
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 * @version    Build @@version@@
 */

namespace PasswordLib\Key\Derivation\PBKDF;

use PasswordLib\Hash\Hash;

/**
 * An implementation of the RFC 2898 PBKDF2 Standard key derivation function
 *
 * @see        http://www.ietf.org/rfc/rfc2898.txt
 * @category   PHPPasswordLib
 * @package    Key
 * @subpackage Derivation
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 */
class PBKDF2
    extends \PasswordLib\Key\Derivation\AbstractDerivation
    implements \PasswordLib\Key\Derivation\PBKDF
{

    /**
     * Derive a key from the supplied arguments
     *
     * @param string $password   The password to derive from
     * @param string $salt       The salt string to use
     * @param int    $iterations The number of iterations to use
     * @param int    $length     The size of the string to generate
     *
     * @return string The derived key
     */
    public function derive($password, $salt, $iterations, $length) {
        $size   = Hash::getHashSize($this->hash);
        $len    = ceil($length / $size);
        $result = '';
        for ($i = 1; $i <= $len; $i++) {
            $tmp = hash_hmac(
                $this->hash,
                $salt . pack('N', $i),
                $password,
                true
            );
            $res = $tmp;
            for ($j = 1; $j < $iterations; $j++) {
                $tmp  = hash_hmac($this->hash, $tmp, $password, true);
                $res ^= $tmp;
            }
            $result .= $res;
        }
        return substr($result, 0, $length);
    }

    /**
     * Get the signature for this implementation
     *
     * This should include all information needed to build the same isntance
     * later.
     *
     * @return string The signature for this instance
     */
    public function getSignature() {
        return 'pbkdf2-' . $this->hash;
    }

}



================================================
FILE: lib/PasswordLib/Key/Derivation/PBKDF.php
================================================
<?php
/**
 * The core PBKDF interface (Password Based Key Derivation Function)
 *
 * This interface must be used to describe all derivation functions that take a
 * password as input and produce a key or hash as output 
 *
 * PHP version 5.3
 *
 * @category   PHPPasswordLib
 * @package    Key
 * @subpackage Derivation
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright  2011 The Authors
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 * @version    Build @@version@@
 */

namespace PasswordLib\Key\Derivation;

/**
 * The core PBKDF interface (Password Based Key Derivation Function)
 *
 * This interface must be used to describe all derivation functions that take a
 * password as input and produce a key or hash as output
 *
 * @category   PHPPasswordLib
 * @package    Key
 * @subpackage Derivation
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @codeCoverageIgnore
 */
interface PBKDF {

    /**
     * Derive a key from the supplied arguments
     *
     * @param string $password   The password to derive from
     * @param string $salt       The salt string to use
     * @param int    $iterations The number of iterations to use
     * @param int    $length     The size of the string to generate
     *
     * @return string The derived key
     */
    public function derive($passkey, $salt, $iterations, $klen);

    /**
     * Get the signature for this implementation
     *
     * This should include all information needed to build the same isntance
     * later.
     *
     * @return string The signature for this instance
     */
    public function getSignature();

}


================================================
FILE: lib/PasswordLib/Key/Factory.php
================================================
<?php
/**
 * The core Key Factory
 *
 * PHP version 5.3
 *
 * @category   PHPPasswordLib
 * @package    Key
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright  2011 The Authors
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 * @version    Build @@version@@
 */

namespace PasswordLib\Key;

/**
 * The core Key Factory
 *
 * @category   PHPPasswordLib
 * @package    Key
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 */
class Factory extends \PasswordLib\Core\AbstractFactory {

    /**
     * @var array An array of KDF class implementations
     */
    protected $kdf = array();

    /**
     * @var array An array of PBKDF class implementations
     */
    protected $pbkdf = array();

    /**
     * @var array An array of symmetric key generator implementations
     */
    protected $symmetricGenerators = array();

    /**
     * Construct the instance, loading the core implementations
     *
     * @return void
     */
    public function __construct() {
        $this->loadPBKDF();
    }

    public function getKDF($name = 'kdf3', array $options = array()) {
        if (isset($this->kdf[$name])) {
            $class = $this->kdf[$name];
            return new $class($options);
        }
        throw new \InvalidArgumentException('Unsupported KDF');
    }

    public function getPBKDF($name = 'pbkdf2', array $options = array()) {
        if (isset($this->pbkdf[$name])) {
            $class = $this->pbkdf[$name];
            return new $class($options);
        }
        throw new \InvalidArgumentException('Unsupported PBKDF');
    }

    public function getPBKDFFromSignature($signature) {
        list ($name, $hash) = explode('-', $signature, 2);
        return $this->getPBKDF($name, array('hash' => $hash));
    }

    public function getSymmetricKeyGenerator() {
    }

    public function registerKDF($name, $class) {
        $this->registerType(
            'kdf',
            __NAMESPACE__ . '\\Derivation\\KDF',
            $name,
            $class
        );
    }

    public function registerPBKDF($name, $class) {
        $this->registerType(
            'pbkdf',
            __NAMESPACE__ . '\\Derivation\\PBKDF',
            $name,
            $class
        );
    }

    protected function loadKDF() {
        $this->loadFiles(
            __DIR__ . '/Derivation/KDF',
            __NAMESPACE__ . '\\Derivation\\KDF\\',
            array($this, 'registerKDF')
        );
    }

    protected function loadPBKDF() {
        $this->loadFiles(
            __DIR__ . '/Derivation/PBKDF',
            __NAMESPACE__ . '\\Derivation\\PBKDF\\',
            array($this, 'registerPBKDF')
        );
    }

}


================================================
FILE: lib/PasswordLib/Password/AbstractPassword.php
================================================
<?php
/**
 * The base abstract password hashing implementation
 *
 * This class provides common functionality to all child implementations
 *
 * PHP version 5.3
 *
 * @category   PHPPasswordLib
 * @package    Password
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright  2011 The Authors
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 * @version    Build @@version@@
 */

namespace PasswordLib\Password;

use PasswordLib\Random\Factory as RandomFactory;
use DomainException;

/**
 * The base abstract password hashing implementation
 *
 * This class provides common functionality to all child implementations
 *
 * @category   PHPPasswordLib
 * @package    Password
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 */
abstract class AbstractPassword implements \PasswordLib\Password\Password {

    /**
     * @var array Default options for this password instance
     */
    protected $defaultOptions = array();

    /**
     * @var Generator The random generator to use for seeds
     */
    protected $generator = null;

    /**
     * @var array Options for this password instance
     */
    protected $options = array();

    /**
     * @var string The prefix for the generated hash
     */
    protected static $prefix = false;

    /**
     * Determine if the hash was made with this method
     *
     * @param string $hash The hashed data to check
     *
     * @return boolean Was the hash created by this method
     */
    public static function detect($hash) {
        $prefix = static::getPrefix();
        return strncmp($hash, $prefix, strlen($prefix)) === 0;
    }

    /**
     * Return the prefix used by this hashing method
     *
     * @return string The prefix used
     */
    public static function getPrefix() {
        return static::$prefix;
    }

    /**
     * Build a new instance
     *
     * @param array     $options    An array of options for the password isntance
     * @param Generator $generator  The random generator to use for seeds
     *
     * @return void
     */
    public function __construct(
        array $options = array(),
        \PasswordLib\Random\Generator $generator = null
    ) {
        $this->setOptions($this->defaultOptions);
        $this->setOptions($options);
        if (is_null($generator)) {
            $random    = new RandomFactory();
            $generator = $random->getMediumStrengthGenerator();
        }
        $this->generator = $generator;
    }

    /**
     * Set an option for the instance
     *
     * @param string $option The option to set
     * @param mixed  $value  The value to set the option to
     *
     * @return $this
     */
    public function setOption($option, $value) {
        $this->options[$option] = $value;
        return $this;
    }

    /**
     * Set the options for the instance
     *
     * @param array $options The options to set
     *
     * @return $this
     */
    public function setOptions(array $options) {
        foreach ($options as $name => $value) {
            $this->setOption($name, $value);
        }
        return $this;
    }

    /**
     * Set the random number generator to use
     *
     * @param Generator $generator  The random generator to use for seeds
     *
     * @return void     
     */
    public function setGenerator(
        \PasswordLib\Random\Generator $generator = null
    ) {
        $this->generator = $generator;
    }

    /**
     * Perform a constant time comparison between two hash strings
     * 
     * This is done to prevent remote timing attacks from giving an attacker
     * information about the hash remotely.  This provides a constant runtime
     * equality check between two strings of the same length. This should be used
     * any time sensitive information is compared, as === can leak information
     * about the position of the difference to an attacker.
     *
     * Additionally, for added protection we're hashing each hash again with the 
     * same random key, to further protect against any form of timing attacks if
     * the two hashes are of different length
     *
     * @param string $hash1 The first hash to compare
     * @param string $hash2 The second hash to compare
     * 
     * @see http://rdist.root.org/2010/07/19/exploiting-remote-timing-attacks/
     * @see http://rdist.root.org/2010/01/07/timing-independent-array-comparison/
     * @return boolean True if the strings are identical
     */
    protected function compareStrings($hash1, $hash2) {
        $key   = $this->generator->generate(1024);
        $hash1 = hash_hmac('sha512', $hash1, $key, true);
        $hash2 = hash_hmac('sha512', $hash2, $key, true);

        $len    = strlen($hash1);
        $result = 0;
        for ($i = 0; $i < $len; $i++) {
            $result |= ord($hash1[$i]) ^ ord($hash2[$i]);
        }
        return $result === 0;
    }

    /**
     * Validates the password for type constraints
     *
     * @param string $password The password to validate
     * 
     * @return string The validated password (casted if needed)
     */
    protected function checkPassword($password) {
        switch (gettype($password)) {
            case 'string':
            case 'integer':
            case 'double':
                return (string) $password;
            case 'object':
                if (method_exists($password, '__tostring')) {
                    return (string) $password;
                }
                // Fall through intentional
            default:
                throw new DomainException(
                    'Invalid password type provided is invalid'
                );
        }
    }
}


================================================
FILE: lib/PasswordLib/Password/Factory.php
================================================
<?php
/**
 * The Password Factory
 *
 * PHP version 5.3
 *
 * @category   PHPPasswordLib
 * @package    Password
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright  2011 The Authors
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 * @version    Build @@version@@
 */

namespace PasswordLib\Password;

use PasswordLib\Password\Implementation\Blowfish;

/**
 * The Password Factory
 *
 * @category   PHPPasswordLib
 * @package    Password
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 */
class Factory extends \PasswordLib\Core\AbstractFactory {

    /**
     * @var array An array of implementation classes
     */
    protected $implementations = array();

    /**
     * Build a new instance of the factory, loading core implementations
     *
     * @return void
     */
    public function __construct() {
        $this->loadImplementations();
    }

    /**
     * Create a new password hash from the supplied password
     *
     * This defaults to using Blowfish if $prefix is not supplied
     *
     * @param string $password The password to hash
     * @param string $prefix   The prefix for the implementation
     *
     * @return string The hashed password
     * @throws DomainException if the supplied prefix is not supported
     */
    public function createHash(
        $password,
        $prefix = '$2a$',
        array $options = array()
    ) {
        if ($prefix === false) {
            throw new \DomainException('Unsupported Prefix Supplied');
        }
        foreach ($this->implementations as $impl) {
            if ($impl::getPrefix() == $prefix) {
                $instance = new $impl($options);
                return $instance->create($password);
            }
        }
        throw new \DomainException('Unsupported Prefix Supplied');
    }

    /**
     * Verify a hash with a supplied password
     *
     * @param string $password The password to check against
     * @param string $hash     The hash to verify
     *
     * @return boolean True if valid, false if not
     * @throws DomainException if the supplied prefix is not supported
     */
    public function verifyHash($password, $hash) {
        foreach ($this->implementations as $impl) {
            if ($impl::detect($hash)) {
                $instance = $impl::loadFromHash($hash);
                return $instance->verify($password, $hash);
            }
        }
        throw new \DomainException('Unsupported Password Hash Supplied');
    }

    /**
     * Register a password implementation for this factory instance
     *
     * @param string $name  The name of the stategy
     * @param string $class The class name of the implementation
     *
     * @return Factory $this The current factory instance
     */
    public function registerImplementation($name, $class) {
        $this->registerType(
            'implementations',
            __NAMESPACE__ . '\\Password',
            $name,
            $class
        );
        return $this;
    }

    /**
     * Load all core password hashing implementations
     *
     * @return void
     */
    protected function loadImplementations() {
        $this->loadFiles(
            __DIR__ . '/Implementation',
            __NAMESPACE__ . '\\Implementation\\',
            array($this, 'registerImplementation')
        );
    }

}

================================================
FILE: lib/PasswordLib/Password/Implementation/APR1.php
================================================
<?php
/**
 * The APR1 password hashing implementation
 *
 * Use this class to generate and validate APR1 password hashes.  APR1 hashes
 * are used primarrily by Apache for .htaccess password storage.
 *
 * PHP version 5.3
 *
 * @see        http://httpd.apache.org/docs/2.2/misc/password_encryptions.html
 * @category   PHPPasswordLib
 * @package    Password
 * @subpackage Implementation
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright  2011 The Authors
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 * @version    Build @@version@@
 */

namespace PasswordLib\Password\Implementation;

use PasswordLib\Random\Factory as RandomFactory;

/**
 * The APR1 password hashing implementation
 *
 * Use this class to generate and validate APR1 password hashes.  APR1 hashes
 * are used primarrily by Apache for .htaccess password storage.
 *
 * @see        http://httpd.apache.org/docs/2.2/misc/password_encryptions.html
 * @category   PHPPasswordLib
 * @package    Password
 * @subpackage Implementation
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 */
class APR1 extends \PasswordLib\Password\AbstractPassword {

    /**
     * @var Generator The random generator to use for seeds
     */
    protected $generator = null;

    /**
     * @var Hash The hash function to use (MD5)
     */
    protected $hash = null;

    /**
     * @var int The number of iterations to perform (1000 for APR1)
     */
    protected $iterations = 1000;

    protected static $prefix = '$apr1$';

    /**
     * Load an instance of the class based upon the supplied hash
     *
     * @param string $hash The hash to load from
     *
     * @return Password the created instance
     * @throws InvalidArgumentException if the hash wasn't created here
     */
    public static function loadFromHash($hash) {
        if (!static::detect($hash)) {
            throw new \InvalidArgumentException('Hash Not Created Here');
        }
        return new static;
    }

    /**
     * Create a password hash for a given plain text password
     *
     * @param string $password The password to hash
     *
     * @return string The formatted password hash
     */
    public function create($password) {
        $password = $this->checkPassword($password);
        $salt     = $this->to64(
            $this->generator->generateInt(0, PHP_INT_MAX),
            8
        );
        return $this->hash($password, $salt, $this->iterations);
    }

    /**
     * Verify a password hash against a given plain text password
     *
     * @param string $password The password to hash
     * @param string $hash     The supplied ahsh to validate
     *
     * @return boolean Does the password validate against the hash
     */
    public function verify($password, $hash) {
        $password = $this->checkPassword($password);
        $bits     = explode('$', $hash);
        if (!isset($bits[3]) || $bits[1] != 'apr1') {
            return false;
        }
        $test = $this->hash($password, $bits[2], $this->iterations);
        return $this->compareStrings($test, $hash);
    }

    /**
     * Perform the hashing of the password
     *
     * @param string $password   The plain text password to hash
     * @param string $salt       The 8 byte salt to use
     * @param int    $iterations The number of iterations to use
     *
     * @return string The hashed password
     */
    protected function hash($password, $salt, $iterations) {
        $len  = strlen($password);
        $text = $password . '$apr1$' . $salt;
        $bin  = md5($password.$salt.$password, true);
        for ($i = $len; $i > 0; $i -= 16) {
            $text .= substr($bin, 0, min(16, $i));
        }
        for ($i = $len; $i > 0; $i >>= 1) {
            $text .= ($i & 1) ? chr(0) : $password[0];
        }
        $bin = $this->iterate($text, $iterations, $salt, $password);
        return $this->convertToHash($bin, $salt);
    }

    protected function iterate($text, $iterations, $salt, $password) {
        $bin = md5($text, true);
        for ($i = 0; $i < $iterations; $i++) {
            $new = ($i & 1) ? $password : $bin;
            if ($i % 3) {
                $new .= $salt;
            }
            if ($i % 7) {
                $new .= $password;
            }
            $new .= ($i & 1) ? $bin : $password;
            $bin  = md5($new, true);
        }
        return $bin;
    }

    protected function convertToHash($bin, $salt) {
        $tmp  = '$apr1$'.$salt.'$';
        $tmp .= $this->to64(
            (ord($bin[0])<<16) | (ord($bin[6])<<8) | ord($bin[12]),
            4
        );
        $tmp .= $this->to64(
            (ord($bin[1])<<16) | (ord($bin[7])<<8) | ord($bin[13]),
            4
        );
        $tmp .= $this->to64(
            (ord($bin[2])<<16) | (ord($bin[8])<<8) | ord($bin[14]),
            4
        );
        $tmp .= $this->to64(
            (ord($bin[3])<<16) | (ord($bin[9])<<8) | ord($bin[15]),
            4
        );
        $tmp .= $this->to64(
            (ord($bin[4])<<16) | (ord($bin[10])<<8) | ord($bin[5]),
            4
        );
        $tmp .= $this->to64(
            ord($bin[11]),
            2
        );
        return $tmp;
    }

    /**
     * Convert the input number to a base64 number of the specified size
     *
     * @param int $num  The number to convert
     * @param int $size The size of the result string
     *
     * @return string The converted representation
     */
    protected function to64($num, $size) {
        static $seed = '';
        if (empty($seed)) {
            $seed = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'.
                    'abcdefghijklmnopqrstuvwxyz';
        }
        $result = '';
        while (--$size >= 0) {
            $result .= $seed[$num & 0x3f];
            $num   >>= 6;
        }
        return $result;
    }

}


================================================
FILE: lib/PasswordLib/Password/Implementation/Blowfish.php
================================================
<?php
/**
 * The Blowfish password hashing implementation
 *
 * Use this class to generate and validate Blowfish password hashes.
 *
 * PHP version 5.3
 *
 * @category   PHPPasswordLib
 * @package    Password
 * @subpackage Implementation
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright  2011 The Authors
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 * @version    Build @@version@@
 */

namespace PasswordLib\Password\Implementation;

use PasswordLib\Random\Factory as RandomFactory;

/**
 * The Blowfish password hashing implementation
 *
 * Use this class to generate and validate Blowfish password hashes.
 *
 * @category   PHPPasswordLib
 * @package    Password
 * @subpackage Implementation
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 */
class Blowfish extends Crypt {

    protected static $prefix = '$2a$';

    protected $saltLen = 22;

    protected $defaultOptions = array(
        'cost' => 10,
    );

    /**
     * Return the prefix used by this hashing method
     *
     * @return string The prefix used
     */
    public static function getPrefix() {
        if (version_compare(PHP_VERSION, '5.3.7') >= 0) {
            return '$2y$';
        } else {
            return '$2a$';
        }
    }

    /**
     * Determine if the hash was made with this method
     *
     * @param string $hash The hashed data to check
     *
     * @return boolean Was the hash created by this method
     */
    public static function detect($hash) {
        static $regex = '/^\$2[ay]\$(0[4-9]|[1-2][0-9]|3[0-1])\$[a-zA-Z0-9.\/]{53}/';
        return 1 == preg_match($regex, $hash);
    }

    /**
     * Load an instance of the class based upon the supplied hash
     *
     * @param string $hash The hash to load from
     *
     * @return Password the created instance
     * @throws InvalidArgumentException if the hash wasn't created here
     */
    public static function loadFromHash($hash) {
        if (!static::detect($hash)) {
            throw new \InvalidArgumentException('Hash Not Created Here');
        }
        list(, , $iterations) = explode('$', $hash, 4);
        return new static(array('cost' => $iterations));
    }

    /**
     * Set an option for the instance
     *
     * @param string $option The option to set
     * @param mixed  $value  The value to set the option to
     *
     * @return $this
     */
    public function setOption($option, $value) {
        if ($option == 'cost') {
            if ($value < 4 || $value > 31) {
                throw new \InvalidArgumentException(
                    'Invalid cost parameter specified, must be between 4 and 31'
                );
            }
        }
        $this->options[$option] = $value;
        return $this;
    }

    protected function generateSalt() {
        $salt    = parent::generateSalt();
        $prefix  = static::getPrefix();
        $prefix .= str_pad($this->options['cost'], 2, '0', STR_PAD_LEFT);
        return $prefix . '$' . $salt;
    }
}

================================================
FILE: lib/PasswordLib/Password/Implementation/Crypt.php
================================================
<?php
/**
 * The Blowfish password hashing implementation
 *
 * Use this class to generate and validate Blowfish password hashes.
 *
 * PHP version 5.3
 *
 * @category   PHPPasswordLib
 * @package    Password
 * @subpackage Implementation
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright  2011 The Authors
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 * @version    Build @@version@@
 */

namespace PasswordLib\Password\Implementation;

use PasswordLib\Random\Factory as RandomFactory;

/**
 * The Blowfish password hashing implementation
 *
 * Use this class to generate and validate Blowfish password hashes.
 *
 * @category   PHPPasswordLib
 * @package    Password
 * @subpackage Implementation
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 */
class Crypt extends \PasswordLib\Password\AbstractPassword {

    /**
     * @var Generator The random generator to use for seeds
     */
    protected $generator = null;

    protected $saltLen = 2;

    /**
     * Determine if the hash was made with this method
     *
     * @param string $hash The hashed data to check
     *
     * @return boolean Was the hash created by this method
     */
    public static function detect($hash) {
        static $regex = '/^[.\/0-9A-Za-z]{13}$/';
        return 1 == preg_match($regex, $hash);
    }

    /**
     * Load an instance of the class based upon the supplied hash
     *
     * @param string $hash The hash to load from
     *
     * @return Password the created instance
     * @throws InvalidArgumentException if the hash wasn't created here
     */
    public static function loadFromHash($hash) {
        if (!static::detect($hash)) {
            throw new \InvalidArgumentException('Hash Not Created Here');
        }
        return new static();
    }

    /**
     * Create a password hash for a given plain text password
     *
     * @param string $password The password to hash
     *
     * @return string The formatted password hash
     */
    public function create($password) {
        $password = $this->checkPassword($password);
        $salt     = $this->generateSalt();
        $result   = crypt($password, $salt);
        if ($result[0] == '*') {
            //@codeCoverageIgnoreStart
            throw new \RuntimeException('Password Could Not Be Created');
            //@codeCoverageIgnoreEnd
        }
        return $result;
    }

    /**
     * Verify a password hash against a given plain text password
     *
     * @param string $password The password to hash
     * @param string $hash     The supplied ahsh to validate
     *
     * @return boolean Does the password validate against the hash
     */
    public function verify($password, $hash) {
        $password = $this->checkPassword($password);
        if (!static::detect($hash)) {
            throw new \InvalidArgumentException(
                'The hash was not created here, we cannot verify it'
            );
        }
        $test = crypt($password, $hash);
        return $this->compareStrings($test, $hash);
    }

    protected function generateSalt() {
        $salt  = $this->generator->generate($this->saltLen);
        $chars = $this->to64($salt);
        return substr($chars, 0, $this->saltLen);
    }

    /**
     * Convert the input number to a base64 number of the specified size
     *
     * @param int $input The number to convert
     *
     * @return string The converted representation
     */
    protected function to64($input) {
        static $itoa = null;
        if (empty($itoa)) {
            $itoa = './ABCDEFGHIJKLMNOPQRSTUVWXYZ'
                    . 'abcdefghijklmnopqrstuvwxyz0123456789';
        }
        $output = '';
        $size   = strlen($input);
        $ictr   = 0;
        do {
            $cval1   = ord($input[$ictr++]);
            $output .= $itoa[$cval1 >> 2];
            $cval1   = ($cval1 & 0x03) << 4;
            if ($ictr >= $size) {
                $output .= $itoa[$cval1];
                break;
            }
            $cval2 = ord($input[$ictr++]);
            $cval1 |= $cval2 >> 4;
            $output .= $itoa[$cval1];
            $cval1   = ($cval2 & 0x0f) << 2;
            if ($ictr >= $size) {
                $output .= $itoa[$cval1];
                break;
            }
            $cval2 = ord($input[$ictr++]);
            $cval1 |= $cval2 >> 6;
            $output .= $itoa[$cval1];
            $output .= $itoa[$cval2 & 0x3f];
        } while (true);
        return $output;
    }
}

================================================
FILE: lib/PasswordLib/Password/Implementation/Drupal.php
================================================
<?php
/**
 * The Drupal password hashing implementation
 *
 * Use this class to generate and validate Drupal password hashes.
 *
 * PHP version 5.3
 *
 * @see        http://www.openwall.com/phpass/
 * @category   PHPPasswordLib
 * @package    Password
 * @subpackage Implementation
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright  2011 The Authors
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 * @version    Build @@version@@
 */

namespace PasswordLib\Password\Implementation;

use PasswordLib\Random\Factory as RandomFactory;

/**
 * The PHPASS password hashing implementation
 *
 * Use this class to generate and validate PHPASS password hashes.
 *
 * @see        http://www.openwall.com/phpass/
 * @category   PHPPasswordLib
 * @package    Password
 * @subpackage Implementation
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 */
class Drupal extends PHPASS {

    /**
     * @var string The prefix for the generated hash
     */
    protected static $prefix = '$S$';

    /**
     * @var string The hash function to use for this instance
     */
    protected $hashFunction = 'sha512';

    /**
     * Determine if the hash was made with this method
     *
     * @param string $hash The hashed data to check
     *
     * @return boolean Was the hash created by this method
     */
    public static function detect($hash) {
        $prefix = preg_quote(static::$prefix, '/');
        return 1 == preg_match('/^'.$prefix.'[a-zA-Z0-9.\/]{95}$/', $hash);
    }

}

================================================
FILE: lib/PasswordLib/Password/Implementation/Hash.php
================================================
<?php
/**
 * The basic Hash implementation.
 *
 * It's worth noting, since there's no prefix, you cannot create a hash using
 * the factory method.
 *
 * PHP version 5.3
 *
 * @category   PHPPasswordLib
 * @package    Password
 * @subpackage Implementation
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright  2011 The Authors
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 * @version    Build @@version@@
 */

namespace PasswordLib\Password\Implementation;

use PasswordLib\Random\Factory as RandomFactory;

/**
 * The basic Hash implementation.
 *
 * It's worth noting, since there's no prefix, you cannot create a hash using
 * the factory method.
 *
 * @category   PHPPasswordLib
 * @package    Password
 * @subpackage Implementation
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 */
class Hash extends \PasswordLib\Password\AbstractPassword {

    /**
     * @var Hash The hash function to use (MD5)
     */
    protected $defaultOptions = array(
        'hash' => 'sha512',
    );

    /**
     * Determine if the hash was made with this method
     *
     * @param string $hash The hashed data to check
     *
     * @return boolean Was the hash created by this method
     */
    public static function detect($hash) {
        $res  = preg_match('/^[a-fA-F0-9]+$/', $hash);
        $res &= (int) in_array(strlen($hash), array(32, 40, 64, 128));
        return (boolean) $res;
    }

    /**
     * Load an instance of the class based upon the supplied hash
     *
     * @param string $hash The hash to load from
     *
     * @return Password the created instance
     * @throws InvalidArgumentException if the hash wasn't created here
     */
    public static function loadFromHash($hash) {
        if (!static::detect($hash)) {
            throw new \InvalidArgumentException('Hash Not Created Here');
        }
        $hashMethod = '';
        switch (strlen($hash)) {
            case 32:
                $hashMethod = 'md5';
                break;
            case 40:
                $hashMethod = 'sha1';
                break;
            case 64:
                $hashMethod = 'sha256';
                break;
            case 128:
                $hashMethod = 'sha512';
                break;
        }
        return new static(array('hash' => $hashMethod));
    }

    /**
     * Create a password hash for a given plain text password
     *
     * @param string $password The password to hash
     *
     * @return string The formatted password hash
     */
    public function create($password) {
        throw new \BadMethodCallException(
            'Unsalted Passwords are only implemented for verification'
        );
    }

    /**
     * Verify a password hash against a given plain text password
     *
     * @param string $password The password to hash
     * @param string $hash     The supplied ahsh to validate
     *
     * @return boolean Does the password validate against the hash
     */
    public function verify($password, $hash) {
        $password = $this->checkPassword($password);
        $test     = hash($this->options['hash'], $password);
        return $this->compareStrings($test, $hash);
    }

}


================================================
FILE: lib/PasswordLib/Password/Implementation/Joomla.php
================================================
<?php
/**
 * The Joomla based hash implementation based off of the md5-hex hash method
 *
 * It's worth noting, since there's no prefix, you cannot create a hash using
 * the factory method.
 *
 * PHP version 5.3
 *
 * @category   PHPPasswordLib
 * @package    Password
 * @subpackage Implementation
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright  2011 The Authors
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 * @version    Build @@version@@
 */

namespace PasswordLib\Password\Implementation;

use PasswordLib\Random\Factory as RandomFactory;

/**
 * The Joomla based hash implementation based off of the md5-hex hash method
 *
 * It's worth noting, since there's no prefix, you cannot create a hash using
 * the factory method.
 *
 * @category   PHPPasswordLib
 * @package    Password
 * @subpackage Implementation
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 */
class Joomla extends \PasswordLib\Password\AbstractPassword {

    /**
     * @var Generator The random generator to use for seeds
     */
    protected $generator = null;

    /**
     * Determine if the hash was made with this method
     *
     * @param string $hash The hashed data to check
     *
     * @return boolean Was the hash created by this method
     */
    public static function detect($hash) {
        return (boolean) preg_match('/^[a-fA-F0-9]{32}:[a-zA-z0-9]{32}$/', $hash);
    }

    /**
     * Load an instance of the class based upon the supplied hash
     *
     * @param string $hash The hash to load from
     *
     * @return Password the created instance
     * @throws InvalidArgumentException if the hash wasn't created here
     */
    public static function loadFromHash($hash) {
        if (!static::detect($hash)) {
            throw new \InvalidArgumentException('Hash Not Created Here');
        }
        return new static();
    }

    /**
     * Create a password hash for a given plain text password
     *
     * @param string $password The password to hash
     *
     * @return string The formatted password hash
     */
    public function create($password) {
        $password = $this->checkPassword($password);
        $chars    = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
            . '0123456789';
        $salt     = $this->generator->generateString(32, $chars);
        $hash     = md5($password . $salt);
        return $hash . ':' . $salt;
    }

    /**
     * Verify a password hash against a given plain text password
     *
     * @param string $password The password to hash
     * @param string $hash     The supplied ahsh to validate
     *
     * @return boolean Does the password validate against the hash
     */
    public function verify($password, $hash) {
        $password = $this->checkPassword($password);
        if (!static::detect($hash)) {
            throw new \InvalidArgumentException(
                'The hash was not created here, we cannot verify it'
            );
        }
        list ($hash, $salt) = explode(':', $hash, 2);
        $test               = md5($password . $salt);
        return $this->compareStrings($test, $hash);
    }

}


================================================
FILE: lib/PasswordLib/Password/Implementation/MD5.php
================================================
<?php
/**
 * The Blowfish password hashing implementation
 *
 * Use this class to generate and validate Blowfish password hashes.
 *
 * PHP version 5.3
 *
 * @category   PHPPasswordLib
 * @package    Password
 * @subpackage Implementation
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright  2011 The Authors
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 * @version    Build @@version@@
 */

namespace PasswordLib\Password\Implementation;

use PasswordLib\Random\Factory as RandomFactory;

/**
 * The Blowfish password hashing implementation
 *
 * Use this class to generate and validate Blowfish password hashes.
 *
 * @category   PHPPasswordLib
 * @package    Password
 * @subpackage Implementation
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 */
class MD5 extends Crypt {

    protected static $prefix = '$1$';

    protected $saltLen = 12;

    /**
     * Determine if the hash was made with this method
     *
     * @param string $hash The hashed data to check
     *
     * @return boolean Was the hash created by this method
     */
    public static function detect($hash) {
        static $regex = '/^\$1\$[a-zA-Z0-9.\/]{8}\$[a-zA-Z0-9.\/]{22}/';
        return 1 == preg_match($regex, $hash);
    }

    protected function generateSalt() {
        $salt = parent::generateSalt();
        return '$1$' . $salt;
    }
}


================================================
FILE: lib/PasswordLib/Password/Implementation/MediaWiki.php
================================================
<?php
/**
 * The MediaWiki password hashing implementation
 *
 * Use this class to generate and validate MediaWiki password hashes.
 *
 * PHP version 5.3
 *
 * @category   PHPPasswordLib
 * @package    Password
 * @subpackage Implementation
 * @author     Michael Braun <michael-dev@fami-braun.de>
 * @copyright  2013 The Authors
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 * @version    Build @@version@@
 */

namespace PasswordLib\Password\Implementation;

use PasswordLib\Random\Factory as RandomFactory;

/**
 * The MediaWiki password hashing implementation
 *
 * Use this class to generate and validate MediaWiki password hashes.
 *
 * @category   PHPPasswordLib
 * @package    Password
 * @subpackage Implementation
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 */
class MediaWiki extends Crypt {

    protected static $prefix = 'mwB';

    public static function detect($hash) {
        $prefix = static::getPrefix();
        return strncmp($hash, $prefix, strlen($prefix)) === 0;
    }

    public function create($password) {
        $prefix   = static::getPrefix();
        $password = $this->checkPassword($password);
        $salt     = $this->generateSalt();
        $result   = $prefix.$salt.'.'.md5($salt.'-'.md5($password));
        return $result;
    }

    public function verify($password, $hash) {
        $prefix   = static::getPrefix();
        $password = $this->checkPassword($password);
        if (!static::detect($hash)) {
            throw new \InvalidArgumentException(
                'The hash was not created here, we cannot verify it'
            );
        }
        preg_match('/^' . $prefix . '(.+)\./', $hash, $match);
        $salt = null;
        if (isset($match[1])) {
            $salt = $match[1];
        }
        $test = $prefix.$salt.'.'.md5($salt.'-'.md5($password));
        return $this->compareStrings($test, $hash);
    }

}


================================================
FILE: lib/PasswordLib/Password/Implementation/PBKDF.php
================================================
<?php
/**
 * The PBKDF based password hashing implementation
 *
 * Use this class to generate and validate PBKDF hashed passwords.
 *
 * PHP version 5.3
 *
 * @see        http://httpd.apache.org/docs/2.2/misc/password_encryptions.html
 * @category   PHPPasswordLib
 * @package    Password
 * @subpackage Implementation
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright  2011 The Authors
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 * @version    Build @@version@@
 */

namespace PasswordLib\Password\Implementation;

use PasswordLib\Key\Factory                 as KeyFactory;
use PasswordLib\Random\Factory              as RandomFactory;
use PasswordLib\Key\Derivation\PBKDF\PBKDF2 as PBKDF2;

/**
 * The PBKDF based password hashing implementation
 *
 * Use this class to generate and validate PBKDF hashed passwords.
 *
 * PHP version 5.3
 *
 * @see        http://httpd.apache.org/docs/2.2/misc/password_encryptions.html
 * @category   PHPPasswordLib
 * @package    Password
 * @subpackage Implementation
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 */
class PBKDF extends \PasswordLib\Password\AbstractPassword {

    protected $defaultOptions = array(
        'kdf'        => 'pbkdf2-sha512',
        'size'       => 40,
        'iterations' => 5000,
    );

    /**
     * @var Generator The Random Number Generator to use for making salts
     */
    protected $generator = null;

    /**
     * @var string The prefix for the generated hash
     */
    protected static $prefix = '$pbkdf$';

    /**
     * Load an instance of the class based upon the supplied hash
     *
     * @param string $hash The hash to load from
     *
     * @return Password the created instance
     * @throws InvalidArgumentException if the hash wasn't created here
     */
    public static function loadFromHash($hash) {
        if (!static::detect($hash)) {
            throw new \InvalidArgumentException('Hash Not Created Here');
        }
        $parts = explode('$', $hash);
        if (count($parts) != 7) {
            throw new \InvalidArgumentException('Hash Not Created Here');
        }
        $signature  = $parts[2];
        $factory    = new KeyFactory();
        $hash       = $factory->getPBKDFFromSignature($signature);
        $iterations = $parts[3];
        $size       = $parts[4];
        return new static(array(
            'kdf'        => $hash,
            'size'       => $size,
            'iterations' => $iterations,
        ));
    }

    /**
     * Set an option for the instance
     *
     * @param string $option The option to set
     * @param mixed  $value  The value to set the option to
     *
     * @return $this
     */
    public function setOption($option, $value) {
        if ($option == 'kdf') {
            if (!$value instanceof \PasswordLib\Key\Derivation\PBKDF) {
                $factory = new KeyFactory();
                $value   = $factory->getPBKDFFromSignature($value);
            }
        }
        $this->options[$option] = $value;
        return $this;
    }

    /**
     * Create a password hash for a given plain text password
     *
     * @param string $password The password to hash
     *
     * @return string The formatted password hash
     */
    public function create($password) {
        $password = $this->checkPassword($password);
        $size     = $this->options['size'] - 8; // remove size of stored bits
        $saltSize = floor($size / 5);  //Use 20% of the size for the salt
        $hashSize = $size - $saltSize;
        $salt     = $this->generator->generate($saltSize);
        return $this->hash(
            $password,
            $salt,
            $this->options['iterations'],
            $hashSize
        );
    }

    /**
     * Verify a password hash against a given plain text password
     *
     * @param string $password The password to hash
     * @param string $hash     The supplied ahsh to validate
     *
     * @return boolean Does the password validate against the hash
     */
    public function verify($password, $hash) {
        $password = $this->checkPassword($password);
        if (strlen($hash) <= 16 || strpos($hash, '$') === false) {
            return false;
        }
        $parts = explode('$', $hash);
        if (count($parts) != 7) {
            return false;
        } elseif ($parts[2] != $this->options['kdf']->getSignature()) {
            return false;
        }
        $iterations = $parts[3];
        $size       = $parts[4];
        $salt       = base64_decode($parts[5]);
        $tmp        = $this->hash($password, $salt, $iterations, $size);
        return $this->compareStrings($tmp, $hash);
    }

    /**
     * Perform the hashing of the password
     *
     * @param string $password   The plain text password to hash
     * @param string $salt       The 8 byte salt to use
     * @param int    $iterations The number of iterations to use
     *
     * @return string The hashed password
     */
    protected function hash($password, $salt, $iterations, $size) {
        $bit = $this->options['kdf']->derive($password, $salt, $iterations, $size);
        $sig = $this->options['kdf']->getSignature();
        $sig = '$pbkdf$' . $sig . '$' . $iterations . '$' . $size;
        return $sig . '$' . base64_encode($salt) . '$' . base64_encode($bit);
    }

}


================================================
FILE: lib/PasswordLib/Password/Implementation/PHPASS.php
================================================
<?php
/**
 * The PHPASS password hashing implementation
 *
 * Use this class to generate and validate PHPASS password hashes.
 *
 * PHP version 5.3
 *
 * @see        http://www.openwall.com/phpass/
 * @category   PHPPasswordLib
 * @package    Password
 * @subpackage Implementation
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright  2011 The Authors
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 * @version    Build @@version@@
 */

namespace PasswordLib\Password\Implementation;

use PasswordLib\Random\Factory as RandomFactory;

/**
 * The PHPASS password hashing implementation
 *
 * Use this class to generate and validate PHPASS password hashes.
 *
 * @see        http://www.openwall.com/phpass/
 * @category   PHPPasswordLib
 * @package    Password
 * @subpackage Implementation
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 */
class PHPASS extends \PasswordLib\Password\AbstractPassword {

    /**
     * @var string The ITOA string to be used for base64 conversion
     */
    protected static $itoa = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ
                                abcdefghijklmnopqrstuvwxyz';

    protected $defaultOptions = array(
        'cost' => 8,
    );

    /**
     * This is the hash function to use.  To be overriden by child classes
     *
     * @var string The hash function to use for this instance
     */
    protected $hashFunction = 'md5';

    /**
     * @var string The prefix for the generated hash
     */
    protected static $prefix = '$P$';

    /**
     * Determine if the hash was made with this method
     *
     * @param string $hash The hashed data to check
     *
     * @return boolean Was the hash created by this method
     */
    public static function detect($hash) {
        $prefix = preg_quote(static::$prefix, '/');
        return 1 == preg_match('/^'.$prefix.'[a-zA-Z0-9.\/]{31}$/', $hash);
    }

    /**
     * Initialize the password hasher by replacing away spaces in the itoa var
     *
     * @return void
     */
    public static function init() {
        static::$itoa = preg_replace('/\s/', '', static::$itoa);
    }

    /**
     * Load an instance of the class based upon the supplied hash
     *
     * @param string $hash The hash to load from
     *
     * @return Password the created instance
     * @throws InvalidArgumentException if the hash wasn't created here
     */
    public static function loadFromHash($hash) {
        if (!static::detect($hash)) {
            throw new \InvalidArgumentException('Hash Not Created Here');
        }
        $iterations = static::decodeIterations($hash[3]);
        return new static(array('cost' => $iterations));
    }

    /**
     * Decode an ITOA encoded iteration count
     *
     * @param string $byte The character to decode
     *
     * @return int The decoded iteration count (base2)
     */
    protected static function decodeIterations($byte) {
        return strpos(static::$itoa, $byte);
    }

    /**
     * Encode a base2 iteration count to a base64 character
     *
     * @param int $number
     *
     * @return string The encoded character
     */
    protected static function encodeIterations($number) {
        return static::$itoa[$number];
    }

    /**
     * Set an option for the instance
     *
     * @param string $option The option to set
     * @param mixed  $value  The value to set the option to
     *
     * @return $this
     */
    public function setOption($option, $value) {
        if ($option == 'cost') {
            if ($value > 30 || $value < 7) {
                throw new \InvalidArgumentException(
                    'Invalid Cost Supplied'
                );
            }
        }
        $this->options[$option] = $value;
        return $this;
    }

    /**
     * Create a password hash for a given plain text password
     *
     * @param string $password The password to hash
     *
     * @return string The formatted password hash
     */
    public function create($password) {
        $password = $this->checkPassword($password);
        $salt     = $this->to64($this->generator->generate(6));
        $prefix   = static::encodeIterations($this->options['cost']) . $salt;
        return static::$prefix . $prefix . $this->hash($password, $salt);
    }

    /**
     * Verify a password hash against a given plain text password
     *
     * @param string $password The password to hash
     * @param string $hash     The supplied ahsh to validate
     *
     * @return boolean Does the password validate against the hash
     */
    public function verify($password, $hash) {
        $password = $this->checkPassword($password);
        if (!static::detect($hash)) {
            throw new \InvalidArgumentException(
                'The hash was not created here, we cannot verify it'
            );
        }
        $iterations = static::decodeIterations($hash[3]);
        if ($iterations != $this->options['cost']) {
            throw new \InvalidArgumentException(
                'Iteration Count Mismatch, Bailing'
            );
        }
        $salt = substr($hash, 4, 8);
        $hash = substr($hash, 12);
        $test = $this->hash($password, $salt);
        return $this->compareStrings($test, $hash);
    }

    /**
     * Execute the hash function with proper iterations
     *
     * @param string $password The password to hash
     * @param string $salt     The salt to use to hash
     *
     * @return string The base64 encoded generated hash
     */
    protected function hash($password, $salt) {
        $count = 1 << $this->options['cost'];
        $hash  = hash($this->hashFunction, $salt . $password, true);
        do {
            $hash = hash($this->hashFunction, $hash . $password, true);
        } while (--$count);
        return $this->to64($hash);
    }

    /**
     * Convert the input number to a base64 number of the specified size
     *
     * @param int $input The number to convert
     *
     * @return string The converted representation
     */
    protected function to64($input) {
        $output = '';
        $count  = strlen($input);
        $ictr   = 0;
        do {
            $value   = ord($input[$ictr++]);
            $output .= static::$itoa[$value & 0x3f];
            if ($ictr < $count) {
                $value |= ord($input[$ictr]) << 8;
            }
            $output .= static::$itoa[($value >> 6) & 0x3f];
            if ($ictr++ >= $count) {
                break;
            }
            if ($ictr < $count) {
                $value |= ord($input[$ictr]) << 16;
            }
            $output .= static::$itoa[($value >> 12) & 0x3f];
            if ($ictr++ < $count) {
                $output .= static::$itoa[($value >> 18) & 0x3f];
            }
        } while ($ictr < $count);
        return $output;
    }

}

PHPASS::init();

================================================
FILE: lib/PasswordLib/Password/Implementation/PHPBB.php
================================================
<?php
/**
 * The PHPBB password hashing implementation
 *
 * Use this class to generate and validate PHPBB password hashes.
 *
 * PHP version 5.3
 *
 * @see        http://www.openwall.com/phpass/
 * @category   PHPPasswordLib
 * @package    Password
 * @subpackage Implementation
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright  2011 The Authors
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 * @version    Build @@version@@
 */

namespace PasswordLib\Password\Implementation;

use PasswordLib\Random\Factory as RandomFactory;

/**
 * The PHPBB password hashing implementation
 *
 * Use this class to generate and validate PHPBB password hashes.
 *
 * @see        http://www.openwall.com/phpass/
 * @category   PHPPasswordLib
 * @package    Password
 * @subpackage Implementation
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 */
class PHPBB extends PHPASS {

    /**
     * @var string The prefix for the generated hash
     */
    protected static $prefix = '$H$';

}

================================================
FILE: lib/PasswordLib/Password/Implementation/SHA256.php
================================================
<?php
/**
 * The Blowfish password hashing implementation
 *
 * Use this class to generate and validate Blowfish password hashes.
 *
 * PHP version 5.3
 *
 * @category   PHPPasswordLib
 * @package    Password
 * @subpackage Implementation
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright  2011 The Authors
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 * @version    Build @@version@@
 */

namespace PasswordLib\Password\Implementation;

use PasswordLib\Random\Factory as RandomFactory;

/**
 * The Blowfish password hashing implementation
 *
 * Use this class to generate and validate Blowfish password hashes.
 *
 * @category   PHPPasswordLib
 * @package    Password
 * @subpackage Implementation
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 */
class SHA256 extends Crypt {

    protected static $prefix = '$5$';

    protected $defaultOptions = array(
        'rounds' => 5000,
    );

    protected $saltLen = 16;

    /**
     * Load an instance of the class based upon the supplied hash
     *
     * @param string $hash The hash to load from
     *
     * @return Password the created instance
     * @throws InvalidArgumentException if the hash wasn't created here
     */
    public static function loadFromHash($hash) {
        if (!static::detect($hash)) {
            throw new \InvalidArgumentException('Hash Not Created Here');
        }
        if (!sscanf($hash, '$5$rounds=%d$', $rounds)) {
            $rounds = 5000;
        }
        return new static(array('rounds' => $rounds));
    }

    /**
     * Determine if the hash was made with this method
     *
     * @param string $hash The hashed data to check
     *
     * @return boolean Was the hash created by this method
     */
    public static function detect($hash) {
        $regex = '#^\$5\$(rounds=\d{4,9}\$)?[a-zA-Z0-9./]{16}\$[a-zA-Z0-9./]{43}$#';
        return 1 == preg_match($regex, $hash);
    }

    /**
     * Set an option for the instance
     *
     * @param string $option The option to set
     * @param mixed  $value  The value to set the option to
     *
     * @return $this
     */
    public function setOption($option, $value) {
        if ($option == 'rounds') {
            if ($value < 1000 || $value > 999999999) {
                throw new \InvalidArgumentException(
                    'Invalid cost parameter specified, ' .
                    'must be between 1000 and 999999999'
                );
            }
        }
        $this->options[$option] = $value;
        return $this;
    }

    protected function generateSalt() {
        $salt = parent::generateSalt();
        return '$5$rounds=' . $this->options['rounds'] . '$' . $salt;
    }

}

================================================
FILE: lib/PasswordLib/Password/Implementation/SHA512.php
================================================
<?php
/**
 * The Blowfish password hashing implementation
 *
 * Use this class to generate and validate Blowfish password hashes.
 *
 * PHP version 5.3
 *
 * @category   PHPPasswordLib
 * @package    Password
 * @subpackage Implementation
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright  2011 The Authors
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 * @version    Build @@version@@
 */

namespace PasswordLib\Password\Implementation;

use PasswordLib\Random\Factory as RandomFactory;

/**
 * The Blowfish password hashing implementation
 *
 * Use this class to generate and validate Blowfish password hashes.
 *
 * @category   PHPPasswordLib
 * @package    Password
 * @subpackage Implementation
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 */
class SHA512 extends Crypt {

    protected static $prefix = '$6$';

    protected $defaultOptions = array(
        'rounds' => 5000,
    );

    protected $saltLen = 16;

    /**
     * Load an instance of the class based upon the supplied hash
     *
     * @param string $hash The hash to load from
     *
     * @return Password the created instance
     * @throws InvalidArgumentException if the hash wasn't created here
     */
    public static function loadFromHash($hash) {
        if (!static::detect($hash)) {
            throw new \InvalidArgumentException('Hash Not Created Here');
        }
        if (!sscanf($hash, '$6$rounds=%d$', $rounds)) {
            $rounds = 5000;
        }
        return new static(array('rounds' => $rounds));
    }

    /**
     * Determine if the hash was made with this method
     *
     * @param string $hash The hashed data to check
     *
     * @return boolean Was the hash created by this method
     */
    public static function detect($hash) {
        $regex = '#^\$6\$(rounds=\d{4,9}\$)?[a-zA-Z0-9./]{16}\$[a-zA-Z0-9./]{86}$#';
        return 1 == preg_match($regex, $hash);
    }

    /**
     * Set an option for the instance
     *
     * @param string $option The option to set
     * @param mixed  $value  The value to set the option to
     *
     * @return $this
     */
    public function setOption($option, $value) {
        if ($option == 'rounds') {
            if ($value < 1000 || $value > 999999999) {
                throw new \InvalidArgumentException(
                    'Invalid cost parameter specified, ' .
                    'must be between 1000 and 999999999'
                );
            }
        }
        $this->options[$option] = $value;
        return $this;
    }

    protected function generateSalt() {
        $salt = parent::generateSalt();
        return '$6$rounds=' . $this->options['rounds'] . '$' . $salt;
    }

}

================================================
FILE: lib/PasswordLib/Password/Password.php
================================================
<?php
/**
 * The core password hash interface
 *
 * All pasword implementations must implement this interface
 *
 * PHP version 5.3
 *
 * @category   PHPPasswordLib
 * @package    Password
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright  2011 The Authors
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 * @version    Build @@version@@
 */

namespace PasswordLib\Password;

/**
 * The core password key interface
 *
 * All pasword implementations must implement this interface
 *
 * @category   PHPPasswordLib
 * @package    Password
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @codeCoverageIgnore
 */
interface Password {

    /**
     * Determine if the hash was made with this method
     *
     * @param string $hash The hashed data to check
     *
     * @return boolean Was the hash created by this method
     */
    public static function detect($hash);

    /**
     * Return the prefix used by this hashing method
     *
     * @return string The prefix used
     */
    public static function getPrefix();

    /**
     * Load an instance of the class based upon the supplied hash
     *
     * @param string $hash The hash to load from
     *
     * @return Password the created instance
     */
    public static function loadFromHash($hash);

    /**
     * Create a password hash for a given plain text password
     *
     * @param string $password The password to hash
     *
     * @return string The formatted password hash
     */
    public function create($password);

    /**
     * Verify a password hash against a given plain text password
     *
     * @param string $password The password to hash
     * @param string $hash     The supplied ahsh to validate
     *
     * @return boolean Does the password validate against the hash
     */
    public function verify($password, $hash);

}


================================================
FILE: lib/PasswordLib/PasswordLib.php
================================================
<?php
/**
 * A core wrapper class to provide easy access to all of the cryptographic functions
 * contained within the library
 *
 * PHP version 5.3
 *
 * @category   PHPPasswordLib
 * @package    Core
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright  2011 The Authors
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 * @version    Build @@version@@
 */

namespace PasswordLib;

/**
 * The autoloader class will be autoloaded at this point even if another autoloader
 * is in use.  So if it does not exist at this point, we know we must bootstrap
 * the libraries.
 */
if (!class_exists('\\PasswordLib\Core\AutoLoader', true)) {
    require_once 'bootstrap.php';
}

use PasswordLib\Password\Factory as PasswordFactory;
use PasswordLib\Random\Factory as RandomFactory;

/**
 * A core wrapper class to provide easy access to some of the cryptographic
 * functions contained within the library
 *
 * @category   PHPPasswordLib
 * @package    Core
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 */
class PasswordLib {

    /**
     * Create a password hash from the supplied password and generator prefix
     *
     * @param string $password The password to hash
     * @param string $prefix   The prefix of the hashing function
     *
     * @return string The generated password hash
     */
    public function createPasswordHash(
        $password,
        $prefix = '$2a$',
        array $options = array()
    ) {
        // if we're in a later version of PHP, we need to change this
        if ($prefix == '$2a$' && version_compare(PHP_VERSION, '5.3.7') >= 0) {
            $prefix = '$2y$';
        }

        $factory = new PasswordFactory();
        return $factory->createHash($password, $prefix, $options);
    }

    /**
     * Verify a password against a supplied password hash
     *
     * @param string $password The supplied password to attempt to verify
     * @param string $hash     The valid hash to verify against
     *
     * @throws \DomainException If the hash is invalid or impossible to verify
     * @return boolean Is the password valid
     */
    public function verifyPasswordHash($password, $hash) {
        $factory = new PasswordFactory();
        return $factory->verifyHash($password, $hash);
    }

    /**
     * Get a random element from the array
     *
     * @param array $sourceArray The source array to fetch from
     *
     * @return mixed A random element from the source array
     */
    public function getRandomArrayElement(array $sourceArray) {
        $keys       = array_keys($sourceArray);
        $upperBound = count($keys);
        $factory    = new RandomFactory;
        $generator  = $factory->getMediumStrengthGenerator();
        $key        = $generator->generateInt(0, $upperBound - 1);
        return $sourceArray[$keys[$key]];
    }

    /**
     * Generate a random full-byte string (characters 0 - 255)
     *
     * @param int $size The length of the generated string
     *
     * @return string The generated string
     */
    public function getRandomBytes($size) {
        $factory   = new RandomFactory;
        $generator = $factory->getMediumStrengthGenerator();
        return $generator->generate($size);
    }

    /**
     * Get a random number between the supplied boundaries
     *
     * @param int $min The smallest bound the generated number can be
     * @param int $max The upper bound on the generated number
     *
     * @return int The generated random number
     */
    public function getRandomNumber($min = 0, $max = PHP_INT_MAX) {
        $factory   = new RandomFactory;
        $generator = $factory->getMediumStrengthGenerator();
        return $generator->generateInt($min, $max);
    }

    /**
     * Generate a random token using base64 characters (a-zA-Z0-9./)
     *
     * @param int $size The number of characters in the generated output
     *
     * @return string The generated token string
     */
    public function getRandomToken($size) {
        $factory   = new RandomFactory;
        $generator = $factory->getMediumStrengthGenerator();
        return $generator->generateString($size);
    }

    /**
     * Shuffle an array.  This will preserve key => value relationships, and return
     * a new array that has been randomized in order.
     *
     * To get keys randomized, simply pass the result through array_values()...
     *
     * @param array $array The input array to randomize
     *
     * @return array The suffled array
     */
    public function shuffleArray(array $array) {
        $factory   = new RandomFactory;
        $generator = $factory->getMediumStrengthGenerator();
        $result    = array();
        $values    = array_values($array);
        $keys      = array_keys($array);
        $max       = count($array);
        for ($i = $max - 1; $i >= 0; $i--) {
            $int                 = $generator->generateInt(0, $i);
            $result[$keys[$int]] = $values[$int];
            unset($keys[$int], $values[$int]);
            $keys   = array_values($keys);
            $values = array_values($values);
        }
        return $result;
    }

    /**
     * Shuffle a string and return the randomized string
     *
     * @param string $string The string to randomize
     *
     * @return string The shuffled string
     */
    public function shuffleString($string) {
        $array  = str_split($string);
        $result = $this->shuffleArray($array);
        return implode('', $result);
    }

}


================================================
FILE: lib/PasswordLib/Random/AbstractMixer.php
================================================
<?php
/**
 * An abstract mixer to implement a common mixing strategy
 *
 * PHP version 5.3
 *
 * @category  PHPPasswordLib
 * @package   Random
 * @author    Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright 2011 The Authors
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 * @version   Build @@version@@
 */

namespace PasswordLib\Random;

/**
 * An abstract mixer to implement a common mixing strategy
 *
 * @see      http://tools.ietf.org/html/rfc4086#section-5.2
 * @category PHPPasswordLib
 * @package  Random
 * @author   Anthony Ferrara <ircmaxell@ircmaxell.com>
 */
abstract class AbstractMixer implements \PasswordLib\Random\Mixer {

    /**
     * Get the block size (the size of the individual blocks used for the mixing)
     * 
     * @return int The block size
     */
    abstract protected function getPartSize();

    /**
     * Mix 2 parts together using one method
     *
     * @param string $part1 The first part to mix
     * @param string $part2 The second part to mix
     * 
     * @return string The mixed data
     */
    abstract protected function mixParts1($part1, $part2);

    /**
     * Mix 2 parts together using another different method
     *
     * @param string $part1 The first part to mix
     * @param string $part2 The second part to mix
     * 
     * @return string The mixed data
     */
    abstract protected function mixParts2($part1, $part2);

    /**
     * Mix the provided array of strings into a single output of the same size
     *
     * All elements of the array should be the same size.
     *
     * @param array $parts The parts to be mixed
     *
     * @return string The mixed result
     */
    public function mix(array $parts) {
        if (empty($parts)) {
            return '';
        }
        $len        = strlen($parts[0]);
        $parts      = $this->normalizeParts($parts);
        $stringSize = count($parts[0]);
        $partsSize  = count($parts);
        $result     = '';
        $offset     = 0;
        for ($i = 0; $i < $stringSize; $i++) {
            $stub = $parts[$offset][$i];
            for ($j = 1; $j < $partsSize; $j++) {
                $newKey = $parts[($j + $offset) % $partsSize][$i];
                //Alternately mix the output for each source
                if ($j % 2 == 1) {
                    $stub ^= $this->mixParts1($stub, $newKey);
                } else {
                    $stub ^= $this->mixParts2($stub, $newKey);
                }
            }
            $result .= $stub;
            $offset  = ($offset + 1) % $partsSize;
        }
        return substr($result, 0, $len);
    }

    /**
     * Normalize the part array and split it block part size.  
     * 
     * This will make all parts the same length and a multiple
     * of the part size
     *
     * @param array $parts The parts to normalize
     * 
     * @return array The normalized and split parts
     */
    protected function normalizeParts(array $parts) {
        $blockSize = $this->getPartSize();
        $callback  = function($value) {
            return strlen($value);
        };
        $maxSize = max(array_map($callback, $parts));
        if ($maxSize % $blockSize != 0) {
            $maxSize += $blockSize - ($maxSize % $blockSize);
        }
        foreach ($parts as &$part) {
            $part = str_pad($part, $maxSize, chr(0));
            $part = str_split($part, $blockSize);
        }
        return $parts;
    }
}


================================================
FILE: lib/PasswordLib/Random/Factory.php
================================================
<?php
/**
 * The Random Factory
 *
 * Use this factory to instantiate random number generators, sources and mixers.
 *
 * PHP version 5.3
 *
 * @category   PHPPasswordLib
 * @package    Random
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright  2011 The Authors
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 * @version    Build @@version@@
 */

namespace PasswordLib\Random;

use PasswordLib\Core\Strength;

/**
 * The Random Factory
 *
 * Use this factory to instantiate random number generators, sources and mixers.
 *
 * @category   PHPPasswordLib
 * @package    Random
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 */
class Factory extends \PasswordLib\Core\AbstractFactory {

    /**
     * @var array A list of available random number mixing strategies
     */
    protected $mixers = array();

    /**
     * @var array A list of available random number sources
     */
    protected $sources = array();

    /**
     * Build a new instance of the factory, loading core mixers and sources
     *
     * @return void
     */
    public function __construct() {
        $this->loadMixers();
        $this->loadSources();
    }

    /**
     * Get a generator for the requested strength
     *
     * @param Strength $strength The requested strength of the random number
     *
     * @return Generator The instantiated generator
     * @throws RuntimeException If an appropriate mixing strategy isn't found
     */
    public function getGenerator(\PasswordLib\Core\Strength $strength) {
        $sources    = $this->getSources();
        $newSources = array();
        foreach ($sources as $source) {
            if ($strength->compare($source::getStrength()) <= 0) {
                $newSources[] = new $source;
            }
        }
        $mixer = $this->findMixer($strength);
        return new Generator($newSources, $mixer);
    }

    /**
     * Get a high strength random number generator
     *
     * High Strength keys should ONLY be used for generating extremely strong
     * cryptographic keys.  Generating them is very resource intensive and may
     * take several minutes or more depending on the requested size.
     *
     * @return Generator The instantiated generator
     */
    public function getHighStrengthGenerator() {
        return $this->getGenerator(new Strength(Strength::HIGH));
    }

    /**
     * Get a low strength random number generator
     *
     * Low Strength should be used anywhere that random strings are needed in a
     * non-cryptographical setting.  They are not strong enough to be used as
     * keys or salts.  They are however useful for one-time use tokens.
     *
     * @return Generator The instantiated generator
     */
    public function getLowStrengthGenerator() {
        return $this->getGenerator(new Strength(Strength::LOW));
    }

    /**
     * Get a medium strength random number generator
     *
     * Medium Strength should be used for most needs of a cryptographic nature.
     * They are strong enough to be used as keys and salts.  However, they do
     * take some time and resources to generate, so they should not be over-used
     *
     * @return Generator The instantiated generator
     */
    public function getMediumStrengthGenerator() {
        return $this->getGenerator(new Strength(Strength::MEDIUM));
    }

    /**
     * Get all loaded mixing strategies
     *
     * @return array An array of mixers
     */
    public function getMixers() {
        return $this->mixers;
    }

    /**
     * Get all loaded random number sources
     *
     * @return array An array of sources
     */
    public function getSources() {
        return $this->sources;
    }

    /**
     * Register a mixing strategy for this factory instance
     *
     * @param string $name  The name of the stategy
     * @param string $class The class name of the implementation
     *
     * @return Factory $this The current factory instance
     */
    public function registerMixer($name, $class) {
        $this->registerType(
            'mixers',
            __NAMESPACE__ . '\\Mixer',
            $name,
            $class
        );
        return $this;
    }

    /**
     * Register a random number source for this factory instance
     *
     * Note that this class must implement the Source interface
     *
     * @param string $name  The name of the stategy
     * @param string $class The class name of the implementation
     *
     * @return Factory $this The current factory instance
     */
    public function registerSource($name, $class) {
        $this->registerType(
            'sources',
            __NAMESPACE__ . '\\Source',
            $name,
            $class
        );
        return $this;
    }

    /**
     * Find a mixer based upon the requested strength
     *
     * @param Strength $strength The strength mixer to find
     *
     * @return Mixer The found mixer
     * @throws RuntimeException if a valid mixer cannot be found
     */
    protected function findMixer(\PasswordLib\Core\Strength $strength) {
        $newMixer = null;
        $fallback = null;
        foreach ($this->getMixers() as $mixer) {
            if ($strength->compare($mixer::getStrength()) == 0) {
                $newMixer = new $mixer;
            } elseif ($strength->compare($mixer::getStrength()) == 1) {
                $fallback = new $mixer;
            }
        }
        if (is_null($newMixer)) {
            if (is_null($fallback)) {
                throw new \RuntimeException('Could not find mixer');
            }
            return $fallback;
        }
        return $newMixer;
    }

    /**
     * Load all core mixing strategies
     *
     * @return void
     */
    protected function loadMixers() {
        $this->loadFiles(
            __DIR__ . '/Mixer',
            __NAMESPACE__ . '\\Mixer\\',
            array($this, 'registerMixer')
        );
    }

    /**
     * Load all core random number sources
     *
     * @return void
     */
    protected function loadSources() {
        $this->loadFiles(
            __DIR__ . '/Source',
            __NAMESPACE__ . '\\Source\\',
            array($this, 'registerSource')
        );
    }

}



================================================
FILE: lib/PasswordLib/Random/Generator.php
================================================
<?php
/**
 * The Random Number Generator Class
 *
 * Use this factory to generate cryptographic quality random numbers (strings)
 *
 * PHP version 5.3
 *
 * @category   PHPPasswordLib
 * @package    Random
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @author     Timo Hamina
 * @copyright  2011 The Authors
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 * @version    Build @@version@@
 */

namespace PasswordLib\Random;

use PasswordLib\Core\BaseConverter;

/**
 * The Random Number Generator Class
 *
 * Use this factory to generate cryptographic quality random numbers (strings)
 *
 * @category   PHPPasswordLib
 * @package    Random
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @author     Timo Hamina
 */
class Generator {

    /**
     * @var Mixer The mixing strategy to use for this generator instance
     */
    protected $mixer = null;

    /**
     * @var array An array of random number sources to use for this generator
     */
    protected $sources = array();

    /**
     * Build a new instance of the generator
     *
     * @param array $sources An array of random data sources to use
     * @param Mixer $mixer   The mixing strategy to use for this generator
     */
    public function __construct(array $sources, Mixer $mixer) {
        foreach ($sources as $source) {
            $this->addSource($source);
        }
        $this->mixer = $mixer;
    }

    /**
     * Add a random number source to the generator
     *
     * @param Source $source The random number source to add
     *
     * @return Generator $this The current generator instance
     */
    public function addSource(Source $source) {
        $this->sources[] = $source;
        return $this;
    }

    /**
     * Generate a random number (string) of the requested size
     *
     * @param int $size The size of the requested random number
     *
     * @return string The generated random number (string)
     */
    public function generate($size) {
        $seeds = array();
        foreach ($this->sources as $source) {
            $seeds[] = $source->generate($size);
        }
        return $this->mixer->mix($seeds);
    }

    /**
     * Generate a random integer with the given range
     *
     * @param int $min The lower bound of the range to generate
     * @param int $max The upper bound of the range to generate
     *
     * @return int The generated random number within the range
     */
    public function generateInt($min = 0, $max = PHP_INT_MAX) {
        $tmp   = (int) max($max, $min);
        $min   = (int) min($max, $min);
        $max   = $tmp;
        $range = $max - $min;
        if ($range == 0) {
            return $max;
        } elseif ($range > PHP_INT_MAX || is_float($range)) {
            /**
             * This works, because PHP will auto-convert it to a float at this point,
             * But on 64 bit systems, the float won't have enough precision to
             * actually store the difference, so we need to check if it's a float
             * and hence auto-converted...
             */
            throw new \RangeException(
                'The supplied range is too great to generate'
            );
        }

        $bits  = $this->countBits($range) + 1;
        $bytes = (int) max(ceil($bits / 8), 1);
        $mask  = (int) (pow(2, $bits) - 1);
        /**
         * The mask is a better way of dropping unused bits.  Basically what it does
         * is to set all the bits in the mask to 1 that we may need.  Since the max
         * range is PHP_INT_MAX, we will never need negative numbers (which would
         * have the MSB set on the max int possible to generate).  Therefore we
         * can just mask that away.  Since pow returns a float, we need to cast
         * it back to an int so the mask will work.
         *
         * On a 64 bit platform, that means that PHP_INT_MAX is 2^63 - 1.  Which
         * is also the mask if 63 bits are needed (by the log(range, 2) call).
         * So if the computed result is negative (meaning the 64th bit is set), the
         * mask will correct that.
         *
         * This turns out to be slightly better than the shift as we don't need to
         * worry about "fixing" negative values.
         */
        do {
            $test   = $this->generate($bytes);
            $result = hexdec(bin2hex($test)) & $mask;
        } while ($result > $range);
        return $result + $min;
    }

    /**
     * Generate a random string of specified length.
     *
     * This uses the supplied character list for generating the new result
     * string.
     *
     * @param int    $length     The length of the generated string
     * @param string $characters An optional list of characters to use
     *
     * @return string The generated random string
     */
    public function generateString($length, $characters = '') {
        if ($length == 0 || strlen($characters) == 1) {
            return '';
        } elseif (empty($characters)) {
            // Default to base 64
            $characters = '0123456789abcdefghijklmnopqrstuvwxyz' .
                          'ABCDEFGHIJKLMNOPQRSTUVWXYZ./';
        }
        // determine how many bytes to generate
        // This is basically doing floor(log(strlen($characters)))
        // But it's fixed to work properly for all numbers
        $len   = strlen($characters);
        $bytes = ceil($length * ($this->countBits($len) + 1) / 8);

        // determine mask for valid characters
        $mask   = 255 - (255 % $len);
        $result = '';
        do {
            $rand = $this->generate($bytes);
            for ($i = 0; $i < $bytes; $i++) {
                if (ord($rand[$i]) > $mask) {
                    continue;
                }
                $result .= $characters[ord($rand[$i]) % $len];
            }
        } while (strlen($result) < $length);
        // We may over-generate, since we always use the entire buffer
        return substr($result, 0, $length);
    }

    /**
     * Get the Mixer used for this instance
     *
     * @return Mixer the current mixer
     */
    public function getMixer() {
        return $this->mixer;
    }

    /**
     * Get the Sources used for this instance
     *
     * @return Source[] the current mixer
     */
    public function getSources() {
        return $this->sources;
    }

    /**
     * Count the minimum number of bits to represent the provided number
     *
     * This is basically floor(log($number, 2))
     * But avoids float precision issues
     *
     * @param int $number The number to count
     *
     * @return int The number of bits
     */
    protected function countBits($number) {
        $log2 = 0;
        while ($number >>= 1) {
            $log2++;
        }
        return $log2;
    }

}


================================================
FILE: lib/PasswordLib/Random/Mixer/Hash.php
================================================
<?php
/**
 * The Hash medium strength mixer class
 *
 * This class implements a mixer based upon the recommendations in RFC 4086
 * section 5.2
 *
 * PHP version 5.3
 *
 * @see        http://tools.ietf.org/html/rfc4086#section-5.2
 * @category   PHPPasswordLib
 * @package    Random
 * @subpackage Mixer
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright  2011 The Authors
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 * @version    Build @@version@@
 */

namespace PasswordLib\Random\Mixer;

use \PasswordLib\Core\Strength;

/**
 * The Hash medium strength mixer class
 *
 * This class implements a mixer based upon the recommendations in RFC 4086
 * section 5.2
 *
 * @see        http://tools.ietf.org/html/rfc4086#section-5.2
 * @category   PHPPasswordLib
 * @package    Random
 * @subpackage Mixer
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 */
class Hash extends \PasswordLib\Random\AbstractMixer {

    /**
     * @var string The hash instance to use
     */
    protected $hash = null;

    /**
     * Build the hash mixer
     *
     * @param string $hash The hash instance to use (defaults to sha512)
     *
     * @return void
     */
    public function __construct($hash = 'sha512') {
        $this->hash = $hash;
    }

    /**
     * Return an instance of Strength indicating the strength of the source
     *
     * @return Strength An instance of one of the strength classes
     */
    public static function getStrength() {
        return new Strength(Strength::MEDIUM);
    }

    /**
     * Test to see if the mixer is available
     *
     * @return boolean If the mixer is available on the system
     */
    public static function test() {
        return true;
    }

    /**
     * Get the block size (the size of the individual blocks used for the mixing)
     *
     * @return int The block size
     */
    protected function getPartSize() {
        return strlen(hash($this->hash, '', true));
    }

    /**
     * Mix 2 parts together using one method
     *
     * @param string $part1 The first part to mix
     * @param string $part2 The second part to mix
     *
     * @return string The mixed data
     */
    protected function mixParts1($part1, $part2) {
        return hash_hmac($this->hash, $part1, $part2, true);
    }

    /**
     * Mix 2 parts together using another different method
     *
     * @param string $part1 The first part to mix
     * @param string $part2 The second part to mix
     *
     * @return string The mixed data
     */
    protected function mixParts2($part1, $part2) {
        return hash_hmac($this->hash, $part2, $part1, true);
    }

}


================================================
FILE: lib/PasswordLib/Random/Mixer.php
================================================
<?php
/**
 * The Mixer strategy interface.
 *
 * All mixing strategies must implement this interface
 *
 * PHP version 5.3
 *
 * @category   PHPPasswordLib
 * @package    Random
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright  2011 The Authors
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 * @version    Build @@version@@
 */

namespace PasswordLib\Random;

/**
 * The Mixer strategy interface.
 *
 * All mixing strategies must implement this interface
 *
 * @category   PHPPasswordLib
 * @package    Random
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @codeCoverageIgnore
 */
interface Mixer {

    /**
     * Return an instance of Strength indicating the strength of the mixer
     *
     * @return Strength An instance of one of the strength classes
     */
    public static function getStrength();

    /**
     * Test to see if the mixer is available
     *
     * @return boolean If the mixer is available on the system
     */
    public static function test();

    /**
     * Mix the provided array of strings into a single output of the same size
     *
     * All elements of the array should be the same size.
     *
     * @param array $parts The parts to be mixed
     *
     * @return string The mixed result
     */
    public function mix(array $parts);

}


================================================
FILE: lib/PasswordLib/Random/Source/CAPICOM.php
================================================
<?php
/**
 * The Capicom Random Number Source
 *
 * This uses the Windows CapiCom Com object to generate random numbers
 *
 * PHP version 5.3
 *
 * @category   PHPPasswordLib
 * @package    Random
 * @subpackage Source
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright  2011 The Authors
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 * @version    Build @@version@@
 */

namespace PasswordLib\Random\Source;

use PasswordLib\Core\Strength;

/**
 * The Capicom Random Number Source
 *
 * This uses the Windows CapiCom Com object to generate random numbers
 *
 * @category   PHPPasswordLib
 * @package    Random
 * @subpackage Source
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @codeCoverageIgnore
 */
class CAPICOM implements \PasswordLib\Random\Source {

    /**
     * Return an instance of Strength indicating the strength of the source
     *
     * @return Strength An instance of one of the strength classes
     */
    public static function getStrength() {
        return new Strength(Strength::MEDIUM);
    }

    /**
     * Generate a random string of the specified size
     *
     * @param int $size The size of the requested random string
     *
     * @return string A string of the requested size
     */
    public function generate($size) {
        if (!class_exists('\\COM', false)) {
            return str_repeat(chr(0), $size);
        }
        try {
            $util = new \COM('CAPICOM.Utilities.1');
            $data = base64_decode($util->GetRandom($size, 0));
            return str_pad($data, $size, chr(0));
        } catch (\Exception $e) {
            unset($e);
            return str_repeat(chr(0), $size);
        }
    }

}


================================================
FILE: lib/PasswordLib/Random/Source/MTRand.php
================================================
<?php
/**
 * The MTRand Random Number Source
 *
 * This source generates low strength random numbers by using the internal
 * mt_rand() function.  By itself it is quite weak.  However when combined with
 * other sources it does provide significant benefit.
 *
 * PHP version 5.3
 *
 * @category   PHPPasswordLib
 * @package    Random
 * @subpackage Source
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright  2011 The Authors
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 * @version    Build @@version@@
 */

namespace PasswordLib\Random\Source;

use PasswordLib\Core\Strength;

/**
 * The MTRand Random Number Source
 *
 * This source generates low strength random numbers by using the internal
 * mt_rand() function.  By itself it is quite weak.  However when combined with
 * other sources it does provide significant benefit.
 *
 * @category   PHPPasswordLib
 * @package    Random
 * @subpackage Source
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @codeCoverageIgnore
 */
class MTRand implements \PasswordLib\Random\Source {

    /**
     * Return an instance of Strength indicating the strength of the source
     *
     * @return Strength An instance of one of the strength classes
     */
    public static function getStrength() {
        // Detect if Suhosin Hardened PHP patch is applied
        if (defined('S_ALL')) {
            return new Strength(Strength::MEDIUM);
        } else {
            return new Strength(Strength::LOW);
        }
    }

    /**
     * Generate a random string of the specified size
     *
     * @param int $size The size of the requested random string
     *
     * @return string A string of the requested size
     */
    public function generate($size) {
        $result = '';
        for ($i = 0; $i < $size; $i++) {
            $result .= chr((mt_rand() ^ mt_rand()) % 256);
        }
        return $result;
    }

}


================================================
FILE: lib/PasswordLib/Random/Source/MicroTime.php
================================================
<?php
/**
 * The Microtime Random Number Source
 *
 * This uses the current micro-second (looped several times) for a **very** weak
 * random number source.  This is only useful when combined with several other
 * stronger sources
 *
 * PHP version 5.3
 *
 * @category   PHPPasswordLib
 * @package    Random
 * @subpackage Source
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright  2011 The Authors
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 * @version    Build @@version@@
 */

namespace PasswordLib\Random\Source;

use PasswordLib\Core\Strength;

/**
 * The Microtime Random Number Source
 *
 * This uses the current micro-second (looped several times) for a **very** weak
 * random number source.  This is only useful when combined with several other
 * stronger sources
 *
 * @category   PHPPasswordLib
 * @package    Random
 * @subpackage Source
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @codeCoverageIgnore
 */
class MicroTime implements \PasswordLib\Random\Source {

    private $state = null;

    /**
     * Return an instance of Strength indicating the strength of the source
     *
     * @return Strength An instance of one of the strength classes
     */
    public static function getStrength() {
        return new Strength(Strength::VERYLOW);
    }

    public function __construct() {
        $state = '';
        if (function_exists('posix_times')) {
            $state .= serialize(posix_times());
        }
        $state      .= getmypid() . memory_get_usage();
        $state      .= serialize($_ENV);
        $this->state = hash('sha512', $state, true);
    }

    /**
     * Generate a random string of the specified size
     *
     * @param int $size The size of the requested random string
     *
     * @return string A string of the requested size
     */
    public function generate($size) {
        $result      = '';
        $seed        = microtime() . memory_get_usage();
        $this->state = hash('sha512', $this->state . $seed, true);
        /**
         * Make the generated randomness a bit better by forcing a GC run which
         * should complete in a indeterminate amount of time, hence improving
         * the strength of the randomness a bit. It's still not crypto-safe,
         * but at least it's more difficult to predict.
         */
        gc_collect_cycles();
        for ($i = 0; $i < $size; $i += 8) {
            $seed        = $this->state . microtime() . pack('N', $i);
            $this->state = hash('sha512', $seed, true);
            /**
             * We only use the first 8 bytes here to prevent exposing the state
             * in its entirety, which could potentially expose other random 
             * generations in the future (in the same process)...
             */
            $result .= substr($this->state, 0, 8);
        }
        return substr($result, 0, $size);
    }

}


================================================
FILE: lib/PasswordLib/Random/Source/Rand.php
================================================
<?php
/**
 * The Rand Random Number Source
 *
 * This source generates low strength random numbers by using the internal
 * rand() function.  By itself it is quite weak.  However when combined with
 * other sources it does provide significant benefit.
 *
 * PHP version 5.3
 *
 * @category   PHPPasswordLib
 * @package    Random
 * @subpackage Source
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright  2011 The Authors
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 * @version    Build @@version@@
 */

namespace PasswordLib\Random\Source;

use PasswordLib\Core\Strength;

/**
 * The Rand Random Number Source
 *
 * This source generates low strength random numbers by using the internal
 * rand() function.  By itself it is quite weak.  However when combined with
 * other sources it does provide significant benefit.
 *
 * @category   PHPPasswordLib
 * @package    Random
 * @subpackage Source
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @codeCoverageIgnore
 */
class Rand implements \PasswordLib\Random\Source {

    /**
     * Return an instance of Strength indicating the strength of the source
     *
     * @return Strength An instance of one of the strength classes
     */
    public static function getStrength() {
        // Detect if Suhosin Hardened PHP patch is applied
        if (defined('S_ALL')) {
            return new Strength(Strength::LOW);
        } else {
            return new Strength(Strength::VERYLOW);
        }
    }

    /**
     * Generate a random string of the specified size
     *
     * @param int $size The size of the requested random string
     *
     * @return string A string of the requested size
     */
    public function generate($size) {
        $result = '';
        for ($i = 0; $i < $size; $i++) {
            $result .= chr((rand() ^ rand()) % 256);
        }
        return $result;
    }

}


================================================
FILE: lib/PasswordLib/Random/Source/URandom.php
================================================
<?php
/**
 * The URandom Random Number Source
 *
 * This uses the *nix /dev/urandom device to generate medium strength numbers
 *
 * PHP version 5.3
 *
 * @category   PHPPasswordLib
 * @package    Random
 * @subpackage Source
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright  2011 The Authors
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 * @version    Build @@version@@
 */

namespace PasswordLib\Random\Source;

use PasswordLib\Core\Strength;

/**
 * The URandom Random Number Source
 *
 * This uses the *nix /dev/urandom device to generate medium strength numbers
 *
 * @category   PHPPasswordLib
 * @package    Random
 * @subpackage Source
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @codeCoverageIgnore
 */
class URandom implements \PasswordLib\Random\Source {

    /**
     * @var string The file to read from
     */
    protected $file = '/dev/urandom';

    /**
     * Return an instance of Strength indicating the strength of the source
     *
     * @return Strength An instance of one of the strength classes
     */
    public static function getStrength() {
        return new Strength(Strength::MEDIUM);
    }

    /**
     * Generate a random string of the specified size
     *
     * @param int $size The size of the requested random string
     *
     * @return string A string of the requested size
     */
    public function generate($size) {
        if ($size == 0 || !file_exists($this->file)) {
            return str_repeat(chr(0), $size);
        }
        $file = fopen($this->file, 'rb');
        if (!$file) {
            return str_repeat(chr(0), $size);
        }
        if (function_exists('stream_set_read_buffer')) {
            stream_set_read_buffer($file, 0);
        }
        $result = fread($file, $size);
        fclose($file);
        return $result;
    }

}


================================================
FILE: lib/PasswordLib/Random/Source/UniqID.php
================================================
<?php
/**
 * The UniqID Random Number Source
 *
 * This uses the internal `uniqid()` function to generate low strength random
 * numbers.
 *
 * PHP version 5.3
 *
 * @category   PHPPasswordLib
 * @package    Random
 * @subpackage Source
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright  2011 The Authors
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 * @version    Build @@version@@
 */

namespace PasswordLib\Random\Source;

use PasswordLib\Core\Strength;

/**
 * The UniqID Random Number Source
 *
 * This uses the internal `uniqid()` function to generate low strength random
 * numbers.
 *
 * @category   PHPPasswordLib
 * @package    Random
 * @subpackage Source
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @codeCoverageIgnore
 */
class UniqID implements \PasswordLib\Random\Source {

    /**
     * Return an instance of Strength indicating the strength of the source
     *
     * @return Strength An instance of one of the strength classes
     */
    public static function getStrength() {
        return new Strength(Strength::LOW);
    }

    /**
     * Generate a random string of the specified size
     *
     * @param int $size The size of the requested random string
     *
     * @return string A string of the requested size
     */
    public function generate($size) {
        $result = '';
        while (strlen($result) < $size) {
            $result = uniqid($result, true);
        }
        return substr($result, 0, $size);
    }

}


================================================
FILE: lib/PasswordLib/Random/Source.php
================================================
<?php
/**
 * The Random Number Source interface.
 *
 * All random number sources must implement this interface
 *
 * PHP version 5.3
 *
 * @category   PHPPasswordLib
 * @package    Random
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright  2011 The Authors
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 * @version    Build @@version@@
 */

namespace PasswordLib\Random;

/**
 * The Random Number Source interface.
 *
 * All random number sources must implement this interface
 *
 * @category   PHPPasswordLib
 * @package    Random
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @codeCoverageIgnore
 */
interface Source {

    /**
     * Return an instance of Strength indicating the strength of the source
     *
     * @return Strength An instance of one of the strength classes
     */
    public static function getStrength();

    /**
     * Generate a random string of the specified size
     *
     * Note: If the source fails to generate enough data, the result must be
     * padded to the requested length.
     *
     * @param int $size The size of the requested random string
     *
     * @return string A string of the requested size
     */
    public function generate($size);

}


================================================
FILE: lib/PasswordLib/bootstrap.php
================================================
<?php
/**
 * Bootstrap the library.  This registers a simple autoloader for autoloading
 * classes
 *
 * If you are using this library inside of another that uses a similar
 * autoloading system, you can use that autoloader instead of this file.
 *
 * PHP version 5.3
 *
 * @category   PHPPasswordLib
 * @package    Core
 * @author     Anthony Ferrara <ircmaxell@ircmaxell.com>
 * @copyright  2011 The Authors
 * @license    http://www.opensource.org/licenses/mit-license.html  MIT License
 * @version    Build @@version@@
 */

namespace PasswordLib;

require_once __DIR__ . '/Core/AutoLoader.php';

$autoloader = new Core\AutoLoader(__NAMESPACE__, dirname(__DIR__));

$autoloader->register();

================================================
FILE: phpunit.xml.dist
================================================
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="true"
         backupStaticAttributes="false"
         bootstrap="test/bootstrap.php"
         colors="false"
         convertErrorsToExceptions="true"
         convertNoticesToExceptions="true"
         convertWarningsToExceptions="true"
         forceCoversAnnotation="false"
         mapTestClassNameToCoveredClassName="false"
         processIsolation="false"
         stopOnError="false"
         stopOnFailure="false"
         stopOnIncomplete="false"
         stopOnSkipped="false"
         testSuiteLoaderClass="PHPUnit_Runner_StandardTestSuiteLoader"
         strict="false"
         verbose="false">
    <testsuites>
        <testsuite name="Unit">
            <directory>test/Unit</directory>
        </testsuite>
    </testsuites>
    <filter>
        <whitelist>
            <directory suffix=".php">lib/</directory>
        </whitelist>
    </filter>
</phpunit>


================================================
FILE: test/Data/Vectors/aes-cbc.test-vectors
================================================
Primitive Name: AES
========================
Key size: Variable
Block size: 128 bits

Test vectors -- set 1
=====================

Set 1 vector 1
    mode=aes-128
    key=2b7e151628aed2a6abf7158809cf4f3c
    iv=000102030405060708090A0B0C0D0E0F
    plain=6bc1bee22e409f96e93d7e117393172a
    cipher=7649abac8119b246cee98e9b12e9197d

Set 1 vector 2
    mode=aes-128
    key=2b7e151628aed2a6abf7158809cf4f3c
    iv=7649ABAC8119B246CEE98E9B12E9197D
    plain=ae2d8a571e03ac9c9eb76fac45af8e51
    cipher=5086cb9b507219ee95db113a917678b2

Set 1 vector 3
    mode=aes-128
    key=2b7e151628aed2a6abf7158809cf4f3c
    iv=5086CB9B507219EE95DB113A917678B2
    plain=30c81c46a35ce411e5fbc1191a0a52ef
    cipher=73bed6b8e3c1743b7116e69e22229516

Set 1 vector 4
    mode=aes-128
    key=2b7e151628aed2a6abf7158809cf4f3c
    iv=73BED6B8E3C1743B7116E69E22229516
    plain=f69f2445df4f9b17ad2b417be66c3710
    cipher=3ff1caa1681fac09120eca307586e1a7

Set 2 vector 1
    mode=aes-192
    key=8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b
    iv=000102030405060708090A0B0C0D0E0F
    plain=6bc1bee22e409f96e93d7e117393172a
    cipher=4f021db243bc633d7178183a9fa071e8

Set 2 vector 2
    mode=aes-192
    key=8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b
    iv=4F021DB243BC633D7178183A9FA071E8
    plain=ae2d8a571e03ac9c9eb76fac45af8e51
    cipher=b4d9ada9ad7dedf4e5e738763f69145a

Set 2 vector 3
    mode=aes-192
    key=8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b
    iv=B4D9ADA9AD7DEDF4E5E738763F69145A
    plain=30c81c46a35ce411e5fbc1191a0a52ef
    cipher=571b242012fb7ae07fa9baac3df102e0

Set 2 vector 4
    mode=aes-192
    key=8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b
    iv=571B242012FB7AE07FA9BAAC3DF102E0
    plain=f69f2445df4f9b17ad2b417be66c3710
    cipher=08b0e27988598881d920a9e64f5615cd

Set 3 vector 1
    mode=aes-256
    key=603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4
    iv=000102030405060708090A0B0C0D0E0F
    plain=6bc1bee22e409f96e93d7e117393172a
    cipher=f58c4c04d6e5f1ba779eabfb5f7bfbd6

Set 3 vector 2
    mode=aes-256
    key=603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4
    iv=F58C4C04D6E5F1BA779EABFB5F7BFBD6
    plain=ae2d8a571e03ac9c9eb76fac45af8e51
    cipher=9cfc4e967edb808d679f777bc6702c7d

Set 3 vector 3
    mode=aes-256
    key=603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4
    iv=9CFC4E967EDB808D679F777BC6702C7D
    plain=30c81c46a35ce411e5fbc1191a0a52ef
    cipher=39f23369a9d9bacfa530e26304231461

Set 3 vector 4
    mode=aes-256
    key=603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4
    iv=39F23369A9D9BACFA530E26304231461
    plain=f69f2445df4f9b17ad2b417be66c3710
    cipher=b2eb05e2c39be9fcda6c19078c6a9d1b





================================================
FILE: test/Data/Vectors/aes-cfb.test-vectors
================================================
Primitive Name: AES
========================
Key size: Variable
Block size: 128 bits

Test vectors -- set 1
=====================

Set 1 vector 1
    mode=aes-128
    key=2b7e151628aed2a6abf7158809cf4f3c
    iv=000102030405060708090A0B0C0D0E0F
    plain=6bc1bee22e409f96e93d7e117393172a
    cipher=3b3fd92eb72dad20333449f8e83cfb4a

Set 1 vector 2
    mode=aes-128
    key=2b7e151628aed2a6abf7158809cf4f3c
    iv=3B3FD92EB72DAD20333449F8E83CFB4A
    plain=ae2d8a571e03ac9c9eb76fac45af8e51
    cipher=c8a64537a0b3a93fcde3cdad9f1ce58b

Set 1 vector 3
    mode=aes-128
    key=2b7e151628aed2a6abf7158809cf4f3c
    iv=C8A64537A0B3A93FCDE3CDAD9F1CE58B
    plain=30c81c46a35ce411e5fbc1191a0a52ef
    cipher=26751f67a3cbb140b1808cf187a4f4df

Set 1 vector 4
    mode=aes-128
    key=2b7e151628aed2a6abf7158809cf4f3c
    iv=26751F67A3CBB140B1808CF187A4F4DF
    plain=f69f2445df4f9b17ad2b417be66c3710
    cipher=c04b05357c5d1c0eeac4c66f9ff7f2e6

Set 2 vector 1
    mode=aes-192
    key=8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b
    iv=000102030405060708090A0B0C0D0E0F
    plain=6bc1bee22e409f96e93d7e117393172a
    cipher=cdc80d6fddf18cab34c25909c99a4174

Set 2 vector 2
    mode=aes-192
    key=8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b
    iv=CDC80D6FDDF18CAB34C25909C99A4174
    plain=ae2d8a571e03ac9c9eb76fac45af8e51
    cipher=67ce7f7f81173621961a2b70171d3d7a

Set 2 vector 3
    mode=aes-192
    key=8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b
    iv=67CE7F7F81173621961A2B70171D3D7A
    plain=30c81c46a35ce411e5fbc1191a0a52ef
    cipher=2e1e8a1dd59b88b1c8e60fed1efac4c9

Set 2 vector 4
    mode=aes-192
    key=8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b
    iv=2E1E8A1DD59B88B1C8E60FED1EFAC4C9
    plain=f69f2445df4f9b17ad2b417be66c3710
    cipher=c05f9f9ca9834fa042ae8fba584b09ff

Set 3 vector 1
    mode=aes-256
    key=603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4
    iv=000102030405060708090A0B0C0D0E0F
    plain=6bc1bee22e409f96e93d7e117393172a
    cipher=DC7E84BFDA79164B7ECD8486985D3860

Set 3 vector 2
    mode=aes-256
    key=603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4
    iv=DC7E84BFDA79164B7ECD8486985D3860
    plain=ae2d8a571e03ac9c9eb76fac45af8e51
    cipher=39ffed143b28b1c832113c6331e5407b

Set 3 vector 3
    mode=aes-256
    key=603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4
    iv=39FFED143B28B1C832113C6331E5407B
    plain=30c81c46a35ce411e5fbc1191a0a52ef
    cipher=df10132415e54b92a13ed0a8267ae2f9

Set 3 vector 4
    mode=aes-256
    key=603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4
    iv=DF10132415E54B92A13ED0A8267AE2F9
    plain=f69f2445df4f9b17ad2b417be66c3710
    cipher=75a385741ab9cef82031623d55b1e471





================================================
FILE: test/Data/Vectors/aes-ctr.test-vectors
================================================
Primitive Name: AES
========================
Key size: Variable
Block size: 128 bits

Test vectors -- set 1
=====================

Set 1 vector 1
    mode=aes-128
    key=2b7e151628aed2a6abf7158809cf4f3c
    iv=f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff
    plain=6bc1bee22e409f96e93d7e117393172a
    cipher=874d6191b620e3261bef6864990db6ce

Set 1 vector 2
    mode=aes-128
    key=2b7e151628aed2a6abf7158809cf4f3c
    iv=f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff
    plain=ae2d8a571e03ac9c9eb76fac45af8e51
    cipher=9806f66b7970fdff8617187bb9fffdff

Set 1 vector 3
    mode=aes-128
    key=2b7e151628aed2a6abf7158809cf4f3c
    iv=f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff
    plain=30c81c46a35ce411e5fbc1191a0a52ef
    cipher=5ae4df3edbd5d35e5b4f09020db03eab

Set 1 vector 4
    mode=aes-128
    key=2b7e151628aed2a6abf7158809cf4f3c
    iv=f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff
    plain=f69f2445df4f9b17ad2b417be66c3710
    cipher=1e031dda2fbe03d1792170a0f3009cee

Set 2 vector 1
    mode=aes-192
    key=8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b
    iv=f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff
    plain=6bc1bee22e409f96e93d7e117393172a
    cipher=1abc932417521ca24f2b0459fe7e6e0b

Set 2 vector 2
    mode=aes-192
    key=8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b
    iv=f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff
    plain=ae2d8a571e03ac9c9eb76fac45af8e51
    cipher=090339ec0aa6faefd5ccc2c6f4ce8e94

Set 2 vector 3
    mode=aes-192
    key=8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b
    iv=f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff
    plain=30c81c46a35ce411e5fbc1191a0a52ef
    cipher=1e36b26bd1ebc670d1bd1d665620abf7

Set 2 vector 4
    mode=aes-192
    key=8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b
    iv=f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff
    plain=f69f2445df4f9b17ad2b417be66c3710
    cipher=4f78a7f6d29809585a97daec58c6b050

Set 3 vector 1
    mode=aes-256
    key=603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4
    iv=f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff
    plain=6bc1bee22e409f96e93d7e117393172a
    cipher=601ec313775789a5b7a7f504bbf3d228

Set 3 vector 2
    mode=aes-256
    key=603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4
    iv=f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff
    plain=ae2d8a571e03ac9c9eb76fac45af8e51
    cipher=f443e3ca4d62b59aca84e990cacaf5c5

Set 3 vector 3
    mode=aes-256
    key=603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4
    iv=f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff
    plain=30c81c46a35ce411e5fbc1191a0a52ef
    cipher=2b0930daa23de94ce87017ba2d84988d

Set 3 vector 4
    mode=aes-256
    key=603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4
    iv=f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff
    plain=f69f2445df4f9b17ad2b417be66c3710
    cipher=dfc9c58db67aada613c2dd08457941a6



================================================
FILE: test/Data/Vectors/aes-ecb.test-vectors
================================================
Primitive Name: AES
========================
Key size: Variable
Block size: 128 bits

Test vectors -- set 1
=====================

Set 1 vector 1
    mode=aes-128
    key=2b7e151628aed2a6abf7158809cf4f3c
    iv=
    plain=6bc1bee22e409f96e93d7e117393172a
    cipher=3ad77bb40d7a3660a89ecaf32466ef97

Set 1 vector 2
    mode=aes-128
    key=2b7e151628aed2a6abf7158809cf4f3c
    iv=
    plain=ae2d8a571e03ac9c9eb76fac45af8e51
    cipher=f5d3d58503b9699de785895a96fdbaaf

Set 1 vector 3
    mode=aes-128
    key=2b7e151628aed2a6abf7158809cf4f3c
    iv=
    plain=30c81c46a35ce411e5fbc1191a0a52ef
    cipher=43b1cd7f598ece23881b00e3ed030688

Set 1 vector 4
    mode=aes-128
    key=2b7e151628aed2a6abf7158809cf4f3c
    iv=
    plain=f69f2445df4f9b17ad2b417be66c3710
    cipher=7b0c785e27e8ad3f8223207104725dd4

Set 2 vector 1
    mode=aes-192
    key=8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b
    iv=
    plain=6bc1bee22e409f96e93d7e117393172a
    cipher=bd334f1d6e45f25ff712a214571fa5cc

Set 2 vector 2
    mode=aes-192
    key=8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b
    iv=
    plain=ae2d8a571e03ac9c9eb76fac45af8e51
    cipher=974104846d0ad3ad7734ecb3ecee4eef

Set 2 vector 3
    mode=aes-192
    key=8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b
    iv=
    plain=30c81c46a35ce411e5fbc1191a0a52ef
    cipher=ef7afd2270e2e60adce0ba2face6444e

Set 2 vector 4
    mode=aes-192
    key=8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b
    iv=
    plain=f69f2445df4f9b17ad2b417be66c3710
    cipher=9a4b41ba738d6c72fb16691603c18e0e

Set 3 vector 1
    mode=aes-256
    key=603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4
    iv=
    plain=6bc1bee22e409f96e93d7e117393172a
    cipher=f3eed1bdb5d2a03c064b5a7e3db181f8

Set 3 vector 2
    mode=aes-256
    key=603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4
    iv=
    plain=ae2d8a571e03ac9c9eb76fac45af8e51
    cipher=591ccb10d410ed26dc5ba74a31362870

Set 3 vector 3
    mode=aes-256
    key=603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4
    iv=
    plain=30c81c46a35ce411e5fbc1191a0a52ef
    cipher=b6ed21b99ca6f4f9f153e7b1beafed1d

Set 3 vector 4
    mode=aes-256
    key=603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4
    iv=
    plain=f69f2445df4f9b17ad2b417be66c3710
    cipher=23304b7a39f9f3ff067d8d8f9e24ecc7





================================================
FILE: test/Data/Vectors/aes-ofb.test-vectors
================================================
Primitive Name: AES
========================
Key size: Variable
Block size: 128 bits

Test vectors -- set 1
=====================

Set 1 vector 1
    mode=aes-128
    key=2b7e151628aed2a6abf7158809cf4f3c
    iv=000102030405060708090A0B0C0D0E0F
    plain=6bc1bee22e409f96e93d7e117393172a
    cipher=3b3fd92eb72dad20333449f8e83cfb4a

Set 1 vector 2
    mode=aes-128
    key=2b7e151628aed2a6abf7158809cf4f3c
    iv=50FE67CC996D32B6DA0937E99BAFEC60
    plain=ae2d8a571e03ac9c9eb76fac45af8e51
    cipher=7789508d16918f03f53c52dac54ed825

Set 1 vector 3
    mode=aes-128
    key=2b7e151628aed2a6abf7158809cf4f3c
    iv=D9A4DADA0892239F6B8B3D7680E15674
    plain=30c81c46a35ce411e5fbc1191a0a52ef
    cipher=9740051e9c5fecf64344f7a82260edcc

Set 1 vector 4
    mode=aes-128
    key=2b7e151628aed2a6abf7158809cf4f3c
    iv=A78819583F0308E7A6BF36B1386ABF23
    plain=f69f2445df4f9b17ad2b417be66c3710
    cipher=304c6528f659c77866a510d9c1d6ae5e

Set 2 vector 1
    mode=aes-192
    key=8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b
    iv=000102030405060708090A0B0C0D0E0F
    plain=6bc1bee22e409f96e93d7e117393172a
    cipher=cdc80d6fddf18cab34c25909c99a4174

Set 2 vector 2
    mode=aes-192
    key=8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b
    iv=A609B38DF3B1133DDDFF2718BA09565E
    plain=ae2d8a571e03ac9c9eb76fac45af8e51
    cipher=fcc28b8d4c63837c09e81700c1100401

Set 2 vector 3
    mode=aes-192
    key=8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b
    iv=52EF01DA52602FE0975F78AC84BF8A50
    plain=30c81c46a35ce411e5fbc1191a0a52ef
    cipher=8d9a9aeac0f6596f559c6d4daf59a5f2

Set 2 vector 4
    mode=aes-192
    key=8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b
    iv=BD5286AC63AABD7EB067AC54B553F71D
    plain=f69f2445df4f9b17ad2b417be66c3710
    cipher=6d9f200857ca6c3e9cac524bd9acc92a

Set 3 vector 1
    mode=aes-256
    key=603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4
    iv=000102030405060708090A0B0C0D0E0F
    plain=6bc1bee22e409f96e93d7e117393172a
    cipher=dc7e84bfda79164b7ecd8486985d3860

Set 3 vector 2
    mode=aes-256
    key=603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4
    iv=B7BF3A5DF43989DD97F0FA97EBCE2F4A
    plain=ae2d8a571e03ac9c9eb76fac45af8e51
    cipher=4febdc6740d20b3ac88f6ad82a4fb08d

Set 3 vector 3
    mode=aes-256
    key=603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4
    iv=E1C656305ED1A7A6563805746FE03EDC
    plain=30c81c46a35ce411e5fbc1191a0a52ef
    cipher=71ab47a086e86eedf39d1c5bba97c408

Set 3 vector 4
    mode=aes-256
    key=603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4
    iv=41635BE625B48AFC1666DD42A09D96E7
    plain=f69f2445df4f9b17ad2b417be66c3710
    cipher=0126141d67f37be8538f5a8be740e484





================================================
FILE: test/Data/Vectors/apr1.custom.test-vectors
================================================
test $apr1$WokpW...$sNDO6MucVqOQSmB06k48R0
test1 $apr1$INUXn/..$D4tETRyYqquDJyKYiCjfx.
test22 $apr1$5lXfE/..$7mAF16euQTZkzhVJ7nUbp.
test333 $apr1$hc/H5...$7ji9BHMaFEPXZJIIMCgp7/
test4444 $apr1$UyvgB/..$fh4qJPC5JhWXp3iF7ngI7/
test55555 $apr1$w7duE...$utZW/cfsV3Jjaoq8rRQQL/
test666666 $apr1$fFPCx/..$k346l8GfsQS0u8dpdqENU0
test7777777 $apr1$.tptp...$xxZiBKl10w7ftyHogPXyl/
test88888888 $apr1$umoDU/..$SVPLaAq.wF2wpb9B.ks6F.
test999999999 $apr1$KmVvj...$jR7R6wRWYugKq/g1s234a1
test10101010101010101010 $apr1$hyQ5v/..$Tje5T1u5XbXrYDn2FM8kQ0
test1111111111111111111111 $apr1$x.EOy...$b0V/ZruWE.1GBFiz937iS.
test121212121212121212121212 $apr1$SmOjJ...$VwViQkt1Nrkyzo71m3a3n1
test13131313131313131313131313 $apr1$EYSwl...$6ZPEPLc7/QzZ9fGl6c7Hr1
test1414141414141414141414141414 $apr1$7SqG4...$uCGljXcelJLRlqcoiUKTL0
test151515151515151515151515151515 $apr1$SG3sn/..$PrTnC4jEz9BS3wUGV2ndu0
test16161616161616161616161616161616 $apr1$PHwda/..$P3Oe5xfyQ4Xr5Zi5DsJkS1
test1717171717171717171717171717171717 $apr1$RaaWN/..$yPS4Uk7JIQYkm4ZRPSFaG0
test181818181818181818181818181818181818 $apr1$53.xD/..$y6Dy5QmEpVCmkxyk3WqTK1
test19191919191919191919191919191919191919 $apr1$6NYn2/..$gAKNPON5FDpSQo96f6zEK0
test2020202020202020202020202020202020202020 $apr1$jYaWX/..$ipT9xnyLXfJQXpa.xJLfE0
test212121212121212121212121212121212121212121 $apr1$CRybl...$vR6yUJWH4lRH0cTb7hjrb.
test22222222222222222222222222222222222222222222 $apr1$8lfVe...$.PQjNdL1Z2boVm6nfxyG41
test2323232323232323232323232323232323232323232323 $apr1$YVr37/..$n9uJ.jngvCu0DnmYhnd261
test242424242424242424242424242424242424242424242424 $apr1$/ptzq...$gCBvAnwhDWe/XPe815qBT0
test25252525252525252525252525252525252525252525252525 $apr1$tLWqn...$MaPYBZF17u4DRSUXKlNBS1
test26262626262626262626262626262626
Download .txt
gitextract_ql7hv72k/

├── .gitignore
├── .travis.yml
├── README.markdown
├── build/
│   ├── .gitignore
│   ├── build.properties
│   ├── build.xml
│   ├── phar.stub.php
│   ├── phing/
│   │   ├── document.xml
│   │   ├── package.xml
│   │   ├── quality.xml
│   │   └── test.xml
│   ├── phpcs/
│   │   └── ruleset.xml
│   └── phpmd/
│       └── ruleset.xml
├── composer.json
├── examples/
│   ├── Password/
│   │   └── drupal.php
│   ├── PasswordLib.php
│   └── Random/
│       ├── numbers.php
│       └── strings.php
├── lib/
│   └── PasswordLib/
│       ├── Core/
│       │   ├── AbstractFactory.php
│       │   ├── AutoLoader.php
│       │   ├── BaseConverter.php
│       │   ├── BigMath/
│       │   │   ├── BCMath.php
│       │   │   ├── GMP.php
│       │   │   └── PHPMath.php
│       │   ├── BigMath.php
│       │   ├── Enum.php
│       │   └── Strength.php
│       ├── Hash/
│       │   └── Hash.php
│       ├── Key/
│       │   ├── Derivation/
│       │   │   ├── AbstractDerivation.php
│       │   │   ├── PBKDF/
│       │   │   │   └── PBKDF2.php
│       │   │   └── PBKDF.php
│       │   └── Factory.php
│       ├── Password/
│       │   ├── AbstractPassword.php
│       │   ├── Factory.php
│       │   ├── Implementation/
│       │   │   ├── APR1.php
│       │   │   ├── Blowfish.php
│       │   │   ├── Crypt.php
│       │   │   ├── Drupal.php
│       │   │   ├── Hash.php
│       │   │   ├── Joomla.php
│       │   │   ├── MD5.php
│       │   │   ├── MediaWiki.php
│       │   │   ├── PBKDF.php
│       │   │   ├── PHPASS.php
│       │   │   ├── PHPBB.php
│       │   │   ├── SHA256.php
│       │   │   └── SHA512.php
│       │   └── Password.php
│       ├── PasswordLib.php
│       ├── Random/
│       │   ├── AbstractMixer.php
│       │   ├── Factory.php
│       │   ├── Generator.php
│       │   ├── Mixer/
│       │   │   └── Hash.php
│       │   ├── Mixer.php
│       │   ├── Source/
│       │   │   ├── CAPICOM.php
│       │   │   ├── MTRand.php
│       │   │   ├── MicroTime.php
│       │   │   ├── Rand.php
│       │   │   ├── URandom.php
│       │   │   └── UniqID.php
│       │   └── Source.php
│       └── bootstrap.php
├── phpunit.xml.dist
└── test/
    ├── Data/
    │   └── Vectors/
    │       ├── aes-cbc.test-vectors
    │       ├── aes-cfb.test-vectors
    │       ├── aes-ctr.test-vectors
    │       ├── aes-ecb.test-vectors
    │       ├── aes-ofb.test-vectors
    │       ├── apr1.custom.test-vectors
    │       ├── apr1.test-vectors
    │       ├── blowfish.custom.test-vectors
    │       ├── ccm-RFC3610.test-vectors
    │       ├── ccm-cavs11-dvpt.decryption.test-vectors
    │       ├── cmac-aes.sp-800-38b.test-vectors
    │       ├── des.test-vectors
    │       ├── drupal.custom.test-vectors
    │       ├── hmac.rfc4231.test-vectors
    │       ├── pbkdf.custom.test-vectors
    │       ├── pbkdf2-draft-josefsson-sha1.test-vectors
    │       ├── pbkdf2-draft-josefsson-sha256.test-vectors
    │       ├── phpass.custom.test-vectors
    │       ├── phpbb.custom.test-vectors
    │       ├── rijndael-256-128.unverified.test-vectors
    │       ├── rijndael-256-192.unverified.test-vectors
    │       ├── rijndael-256-256.unverified.test-vectors
    │       ├── triple-des-2-key-128-64.unverified.test-vectors
    │       └── triple-des-3-key-192-64.unverified.test-vectors
    ├── Mocks/
    │   ├── AbstractMock.php
    │   ├── Cipher/
    │   │   ├── Block/
    │   │   │   └── Cipher.php
    │   │   └── Factory.php
    │   ├── Core/
    │   │   ├── Enum.php
    │   │   ├── Factory.php
    │   │   └── Strength.php
    │   ├── Key/
    │   │   └── Derivation/
    │   │       └── PBKDF.php
    │   └── Random/
    │       ├── Generator.php
    │       ├── Mixer.php
    │       └── Source.php
    ├── Unit/
    │   ├── Core/
    │   │   ├── AbstractFactoryTest.php
    │   │   ├── BaseConverterTest.php
    │   │   ├── BigMath/
    │   │   │   ├── BCMathTest.php
    │   │   │   ├── GMPTest.php
    │   │   │   └── PHPMathTest.php
    │   │   ├── BigMathTest.php
    │   │   ├── EnumTest.php
    │   │   └── StrengthTest.php
    │   ├── Hash/
    │   │   └── HashTest.php
    │   ├── Key/
    │   │   ├── Derivation/
    │   │   │   └── PBKDF/
    │   │   │       └── PBKDF2Test.php
    │   │   └── FactoryTest.php
    │   ├── Password/
    │   │   ├── FactoryTest.php
    │   │   └── Implementation/
    │   │       ├── APR1Test.php
    │   │       ├── BlowfishTest.php
    │   │       ├── CryptTest.php
    │   │       ├── DrupalTest.php
    │   │       ├── HashTest.php
    │   │       ├── JoomlaTest.php
    │   │       ├── PBKDFTest.php
    │   │       ├── PHPASSTest.php
    │   │       ├── PHPBBTest.php
    │   │       ├── Password_TestCase.php
    │   │       ├── SHA256Test.php
    │   │       └── SHA512Test.php
    │   ├── PasswordLibTest.php
    │   └── Random/
    │       ├── FactoryTest.php
    │       ├── GeneratorTest.php
    │       ├── Mixer/
    │       │   └── HashTest.php
    │       └── Source/
    │           ├── CAPICOMTest.php
    │           ├── MTRandTest.php
    │           ├── MicroTimeTest.php
    │           ├── RandTest.php
    │           ├── URandomTest.php
    │           └── UniqIDTest.php
    ├── Vectors/
    │   ├── Key/
    │   │   └── Derivation/
    │   │       └── PBKDF/
    │   │           └── PBKDF2Test.php
    │   ├── Password/
    │   │   └── Implementation/
    │   │       ├── APR1Test.php
    │   │       ├── BlowfishTest.php
    │   │       ├── DrupalTest.php
    │   │       ├── PBKDFTest.php
    │   │       ├── PHPASSTest.php
    │   │       └── PHPBBTest.php
    │   └── Random/
    │       └── GeneratorTest.php
    ├── bootstrap.php
    └── lib/
        └── VectorParser/
            ├── CAVS.php
            ├── NESSIE.php
            ├── RFC3610.php
            └── SSV.php
Download .txt
SYMBOL INDEX (670 symbols across 100 files)

FILE: lib/PasswordLib/Core/AbstractFactory.php
  class AbstractFactory (line 24) | abstract class AbstractFactory {
    method registerType (line 42) | protected function registerType(
    method loadFiles (line 71) | protected function loadFiles($directory, $namespace, $callback) {

FILE: lib/PasswordLib/Core/AutoLoader.php
  class AutoLoader (line 26) | class AutoLoader {
    method __construct (line 46) | public function __construct($namespace, $path) {
    method load (line 58) | public function load($class) {
    method register (line 79) | public function register() {
    method unregister (line 88) | public function unregister() {

FILE: lib/PasswordLib/Core/BaseConverter.php
  class BaseConverter (line 27) | class BaseConverter {
    method convertFromBinary (line 37) | public static function convertFromBinary($string, $characters) {
    method convertToBinary (line 62) | public static function convertToBinary($string, $characters) {
    method baseConvert (line 91) | public static function baseConvert(array $source, $srcBase, $dstBase) {

FILE: lib/PasswordLib/Core/BigMath.php
  class BigMath (line 23) | abstract class BigMath {
    method createFromServerConfiguration (line 33) | public static function createFromServerConfiguration() {
    method add (line 53) | abstract public function add($left, $right);
    method subtract (line 63) | abstract public function subtract($left, $right);

FILE: lib/PasswordLib/Core/BigMath/BCMath.php
  class BCMath (line 24) | class BCMath extends \PasswordLib\Core\BigMath {
    method add (line 34) | public function add($left, $right) {
    method subtract (line 46) | public function subtract($left, $right) {

FILE: lib/PasswordLib/Core/BigMath/GMP.php
  class GMP (line 24) | class GMP extends \PasswordLib\Core\BigMath {
    method add (line 34) | public function add($left, $right) {
    method subtract (line 46) | public function subtract($left, $right) {

FILE: lib/PasswordLib/Core/BigMath/PHPMath.php
  class PHPMath (line 26) | class PHPMath extends \PasswordLib\Core\BigMath {
    method add (line 36) | public function add($left, $right) {
    method subtract (line 69) | public function subtract($left, $right) {
    method addBinary (line 94) | protected function addBinary($left, $right) {
    method subtractBinary (line 122) | protected function subtractBinary($left, $right) {
    method compliment (line 147) | protected function compliment($string) {
    method normalize (line 163) | protected function normalize($string) {

FILE: lib/PasswordLib/Core/Enum.php
  class Enum (line 29) | abstract class Enum {
    method __construct (line 55) | public function __construct($value = null, $strict = false) {
    method __toString (line 74) | public function __toString() {
    method compare (line 85) | public function compare(Enum $arg) {
    method getConstList (line 102) | public function getConstList($include_default = false) {

FILE: lib/PasswordLib/Core/Strength.php
  class Strength (line 26) | class Strength extends Enum {

FILE: lib/PasswordLib/Hash/Hash.php
  class Hash (line 35) | class Hash {
    method getBlockSize (line 285) | public static function getBlockSize($hash) {
    method getBlockSizeInBits (line 296) | public static function getBlockSizeInBits($hash) {
    method getHashSize (line 310) | public static function getHashSize($hash) {
    method getHashSizeInBits (line 321) | public static function getHashSizeInBits($hash) {
    method isAvailable (line 335) | public static function isAvailable($hash) {
    method isSecure (line 353) | public static function isSecure($hash) {

FILE: lib/PasswordLib/Key/Derivation/AbstractDerivation.php
  class AbstractDerivation (line 26) | abstract class AbstractDerivation {
    method __construct (line 47) | public function __construct(array $options = array()) {

FILE: lib/PasswordLib/Key/Derivation/PBKDF.php
  type PBKDF (line 33) | interface PBKDF {
    method derive (line 45) | public function derive($passkey, $salt, $iterations, $klen);
    method getSignature (line 55) | public function getSignature();

FILE: lib/PasswordLib/Key/Derivation/PBKDF/PBKDF2.php
  class PBKDF2 (line 30) | class PBKDF2
    method derive (line 45) | public function derive($password, $salt, $iterations, $length) {
    method getSignature (line 74) | public function getSignature() {

FILE: lib/PasswordLib/Key/Factory.php
  class Factory (line 24) | class Factory extends \PasswordLib\Core\AbstractFactory {
    method __construct (line 46) | public function __construct() {
    method getKDF (line 50) | public function getKDF($name = 'kdf3', array $options = array()) {
    method getPBKDF (line 58) | public function getPBKDF($name = 'pbkdf2', array $options = array()) {
    method getPBKDFFromSignature (line 66) | public function getPBKDFFromSignature($signature) {
    method getSymmetricKeyGenerator (line 71) | public function getSymmetricKeyGenerator() {
    method registerKDF (line 74) | public function registerKDF($name, $class) {
    method registerPBKDF (line 83) | public function registerPBKDF($name, $class) {
    method loadKDF (line 92) | protected function loadKDF() {
    method loadPBKDF (line 100) | protected function loadPBKDF() {

FILE: lib/PasswordLib/Password/AbstractPassword.php
  class AbstractPassword (line 31) | abstract class AbstractPassword implements \PasswordLib\Password\Password {
    method detect (line 60) | public static function detect($hash) {
    method getPrefix (line 70) | public static function getPrefix() {
    method __construct (line 82) | public function __construct(
    method setOption (line 103) | public function setOption($option, $value) {
    method setOptions (line 115) | public function setOptions(array $options) {
    method setGenerator (line 129) | public function setGenerator(
    method compareStrings (line 155) | protected function compareStrings($hash1, $hash2) {
    method checkPassword (line 175) | protected function checkPassword($password) {

FILE: lib/PasswordLib/Password/Factory.php
  class Factory (line 26) | class Factory extends \PasswordLib\Core\AbstractFactory {
    method __construct (line 38) | public function __construct() {
    method createHash (line 53) | public function createHash(
    method verifyHash (line 79) | public function verifyHash($password, $hash) {
    method registerImplementation (line 97) | public function registerImplementation($name, $class) {
    method loadImplementations (line 112) | protected function loadImplementations() {

FILE: lib/PasswordLib/Password/Implementation/APR1.php
  class APR1 (line 36) | class APR1 extends \PasswordLib\Password\AbstractPassword {
    method loadFromHash (line 63) | public static function loadFromHash($hash) {
    method create (line 77) | public function create($password) {
    method verify (line 94) | public function verify($password, $hash) {
    method hash (line 113) | protected function hash($password, $salt, $iterations) {
    method iterate (line 127) | protected function iterate($text, $iterations, $salt, $password) {
    method convertToHash (line 143) | protected function convertToHash($bin, $salt) {
    method to64 (line 180) | protected function to64($num, $size) {

FILE: lib/PasswordLib/Password/Implementation/Blowfish.php
  class Blowfish (line 32) | class Blowfish extends Crypt {
    method getPrefix (line 47) | public static function getPrefix() {
    method detect (line 62) | public static function detect($hash) {
    method loadFromHash (line 75) | public static function loadFromHash($hash) {
    method setOption (line 91) | public function setOption($option, $value) {
    method generateSalt (line 103) | protected function generateSalt() {

FILE: lib/PasswordLib/Password/Implementation/Crypt.php
  class Crypt (line 32) | class Crypt extends \PasswordLib\Password\AbstractPassword {
    method detect (line 48) | public static function detect($hash) {
    method loadFromHash (line 61) | public static function loadFromHash($hash) {
    method create (line 75) | public function create($password) {
    method verify (line 95) | public function verify($password, $hash) {
    method generateSalt (line 106) | protected function generateSalt() {
    method to64 (line 119) | protected function to64($input) {

FILE: lib/PasswordLib/Password/Implementation/Drupal.php
  class Drupal (line 34) | class Drupal extends PHPASS {
    method detect (line 53) | public static function detect($hash) {

FILE: lib/PasswordLib/Password/Implementation/Hash.php
  class Hash (line 34) | class Hash extends \PasswordLib\Password\AbstractPassword {
    method detect (line 50) | public static function detect($hash) {
    method loadFromHash (line 64) | public static function loadFromHash($hash) {
    method create (line 93) | public function create($password) {
    method verify (line 107) | public function verify($password, $hash) {

FILE: lib/PasswordLib/Password/Implementation/Joomla.php
  class Joomla (line 34) | class Joomla extends \PasswordLib\Password\AbstractPassword {
    method detect (line 48) | public static function detect($hash) {
    method loadFromHash (line 60) | public static function loadFromHash($hash) {
    method create (line 74) | public function create($password) {
    method verify (line 91) | public function verify($password, $hash) {

FILE: lib/PasswordLib/Password/Implementation/MD5.php
  class MD5 (line 32) | class MD5 extends Crypt {
    method detect (line 45) | public static function detect($hash) {
    method generateSalt (line 50) | protected function generateSalt() {

FILE: lib/PasswordLib/Password/Implementation/MediaWiki.php
  class MediaWiki (line 32) | class MediaWiki extends Crypt {
    method detect (line 36) | public static function detect($hash) {
    method create (line 41) | public function create($password) {
    method verify (line 49) | public function verify($password, $hash) {

FILE: lib/PasswordLib/Password/Implementation/PBKDF.php
  class PBKDF (line 38) | class PBKDF extends \PasswordLib\Password\AbstractPassword {
    method loadFromHash (line 64) | public static function loadFromHash($hash) {
    method setOption (line 92) | public function setOption($option, $value) {
    method create (line 110) | public function create($password) {
    method verify (line 132) | public function verify($password, $hash) {
    method hash (line 159) | protected function hash($password, $salt, $iterations, $size) {

FILE: lib/PasswordLib/Password/Implementation/PHPASS.php
  class PHPASS (line 34) | class PHPASS extends \PasswordLib\Password\AbstractPassword {
    method detect (line 65) | public static function detect($hash) {
    method init (line 75) | public static function init() {
    method loadFromHash (line 87) | public static function loadFromHash($hash) {
    method decodeIterations (line 102) | protected static function decodeIterations($byte) {
    method encodeIterations (line 113) | protected static function encodeIterations($number) {
    method setOption (line 125) | public function setOption($option, $value) {
    method create (line 144) | public function create($password) {
    method verify (line 159) | public function verify($password, $hash) {
    method hash (line 186) | protected function hash($password, $salt) {
    method to64 (line 202) | protected function to64($input) {

FILE: lib/PasswordLib/Password/Implementation/PHPBB.php
  class PHPBB (line 34) | class PHPBB extends PHPASS {

FILE: lib/PasswordLib/Password/Implementation/SHA256.php
  class SHA256 (line 32) | class SHA256 extends Crypt {
    method loadFromHash (line 50) | public static function loadFromHash($hash) {
    method detect (line 67) | public static function detect($hash) {
    method setOption (line 80) | public function setOption($option, $value) {
    method generateSalt (line 93) | protected function generateSalt() {

FILE: lib/PasswordLib/Password/Implementation/SHA512.php
  class SHA512 (line 32) | class SHA512 extends Crypt {
    method loadFromHash (line 50) | public static function loadFromHash($hash) {
    method detect (line 67) | public static function detect($hash) {
    method setOption (line 80) | public function setOption($option, $value) {
    method generateSalt (line 93) | protected function generateSalt() {

FILE: lib/PasswordLib/Password/Password.php
  type Password (line 29) | interface Password {
    method detect (line 38) | public static function detect($hash);
    method getPrefix (line 45) | public static function getPrefix();
    method loadFromHash (line 54) | public static function loadFromHash($hash);
    method create (line 63) | public function create($password);
    method verify (line 73) | public function verify($password, $hash);

FILE: lib/PasswordLib/PasswordLib.php
  class PasswordLib (line 38) | class PasswordLib {
    method createPasswordHash (line 48) | public function createPasswordHash(
    method verifyPasswordHash (line 71) | public function verifyPasswordHash($password, $hash) {
    method getRandomArrayElement (line 83) | public function getRandomArrayElement(array $sourceArray) {
    method getRandomBytes (line 99) | public function getRandomBytes($size) {
    method getRandomNumber (line 113) | public function getRandomNumber($min = 0, $max = PHP_INT_MAX) {
    method getRandomToken (line 126) | public function getRandomToken($size) {
    method shuffleArray (line 142) | public function shuffleArray(array $array) {
    method shuffleString (line 166) | public function shuffleString($string) {

FILE: lib/PasswordLib/Random/AbstractMixer.php
  class AbstractMixer (line 25) | abstract class AbstractMixer implements \PasswordLib\Random\Mixer {
    method getPartSize (line 32) | abstract protected function getPartSize();
    method mixParts1 (line 42) | abstract protected function mixParts1($part1, $part2);
    method mixParts2 (line 52) | abstract protected function mixParts2($part1, $part2);
    method mix (line 63) | public function mix(array $parts) {
    method normalizeParts (line 100) | protected function normalizeParts(array $parts) {

FILE: lib/PasswordLib/Random/Factory.php
  class Factory (line 30) | class Factory extends \PasswordLib\Core\AbstractFactory {
    method __construct (line 47) | public function __construct() {
    method getGenerator (line 60) | public function getGenerator(\PasswordLib\Core\Strength $strength) {
    method getHighStrengthGenerator (line 81) | public function getHighStrengthGenerator() {
    method getLowStrengthGenerator (line 94) | public function getLowStrengthGenerator() {
    method getMediumStrengthGenerator (line 107) | public function getMediumStrengthGenerator() {
    method getMixers (line 116) | public function getMixers() {
    method getSources (line 125) | public function getSources() {
    method registerMixer (line 137) | public function registerMixer($name, $class) {
    method registerSource (line 157) | public function registerSource($name, $class) {
    method findMixer (line 175) | protected function findMixer(\PasswordLib\Core\Strength $strength) {
    method loadMixers (line 199) | protected function loadMixers() {
    method loadSources (line 212) | protected function loadSources() {

FILE: lib/PasswordLib/Random/Generator.php
  class Generator (line 32) | class Generator {
    method __construct (line 50) | public function __construct(array $sources, Mixer $mixer) {
    method addSource (line 64) | public function addSource(Source $source) {
    method generate (line 76) | public function generate($size) {
    method generateInt (line 92) | public function generateInt($min = 0, $max = PHP_INT_MAX) {
    method generateString (line 148) | public function generateString($length, $characters = '') {
    method getMixer (line 183) | public function getMixer() {
    method getSources (line 192) | public function getSources() {
    method countBits (line 206) | protected function countBits($number) {

FILE: lib/PasswordLib/Random/Mixer.php
  type Mixer (line 29) | interface Mixer {
    method getStrength (line 36) | public static function getStrength();
    method test (line 43) | public static function test();
    method mix (line 54) | public function mix(array $parts);

FILE: lib/PasswordLib/Random/Mixer/Hash.php
  class Hash (line 36) | class Hash extends \PasswordLib\Random\AbstractMixer {
    method __construct (line 50) | public function __construct($hash = 'sha512') {
    method getStrength (line 59) | public static function getStrength() {
    method test (line 68) | public static function test() {
    method getPartSize (line 77) | protected function getPartSize() {
    method mixParts1 (line 89) | protected function mixParts1($part1, $part2) {
    method mixParts2 (line 101) | protected function mixParts2($part1, $part2) {

FILE: lib/PasswordLib/Random/Source.php
  type Source (line 29) | interface Source {
    method getStrength (line 36) | public static function getStrength();
    method generate (line 48) | public function generate($size);

FILE: lib/PasswordLib/Random/Source/CAPICOM.php
  class CAPICOM (line 33) | class CAPICOM implements \PasswordLib\Random\Source {
    method getStrength (line 40) | public static function getStrength() {
    method generate (line 51) | public function generate($size) {

FILE: lib/PasswordLib/Random/Source/MTRand.php
  class MTRand (line 37) | class MTRand implements \PasswordLib\Random\Source {
    method getStrength (line 44) | public static function getStrength() {
    method generate (line 60) | public function generate($size) {

FILE: lib/PasswordLib/Random/Source/MicroTime.php
  class MicroTime (line 37) | class MicroTime implements \PasswordLib\Random\Source {
    method getStrength (line 46) | public static function getStrength() {
    method __construct (line 50) | public function __construct() {
    method generate (line 67) | public function generate($size) {

FILE: lib/PasswordLib/Random/Source/Rand.php
  class Rand (line 37) | class Rand implements \PasswordLib\Random\Source {
    method getStrength (line 44) | public static function getStrength() {
    method generate (line 60) | public function generate($size) {

FILE: lib/PasswordLib/Random/Source/URandom.php
  class URandom (line 33) | class URandom implements \PasswordLib\Random\Source {
    method getStrength (line 45) | public static function getStrength() {
    method generate (line 56) | public function generate($size) {

FILE: lib/PasswordLib/Random/Source/UniqID.php
  class UniqID (line 35) | class UniqID implements \PasswordLib\Random\Source {
    method getStrength (line 42) | public static function getStrength() {
    method generate (line 53) | public function generate($size) {

FILE: test/Mocks/AbstractMock.php
  class AbstractMock (line 24) | class AbstractMock {
    method init (line 28) | public static function init() {}
    method __construct (line 30) | public function __construct(array $callbacks = array()) {
    method __call (line 34) | public function __call($name, array $args = array()) {

FILE: test/Mocks/Cipher/Block/Cipher.php
  class Cipher (line 26) | class Cipher extends \PasswordLibTest\Mocks\AbstractMock implements \Pas...
    method init (line 30) | public static function init() {
    method getSupportedCiphers (line 40) | public static function getSupportedCiphers() {
    method decryptBlock (line 55) | public function decryptBlock($data) {
    method encryptBlock (line 70) | public function encryptBlock($data) {
    method setKey (line 75) | public function setKey($key) {
    method getBlockSize (line 86) | public function getBlockSize() {
    method getCipher (line 95) | public function getCipher() {
    method getKeySize (line 104) | public function getKeySize() {

FILE: test/Mocks/Cipher/Factory.php
  class Factory (line 31) | class Factory extends \PasswordLib\Cipher\Factory {
    method __construct (line 43) | public function __construct(array $callbacks = array()) {
    method __call (line 47) | public function __call($name, $args) {
    method getBlockCipher (line 65) | public function getBlockCipher($cipher) {
    method getMode (line 80) | public function getMode(
    method registerCipher (line 101) | public function registerCipher($name, $class) {
    method registerMode (line 114) | public function registerMode($name, $class) {

FILE: test/Mocks/Core/Enum.php
  class Enum (line 24) | class Enum extends \PasswordLib\Core\Enum {

FILE: test/Mocks/Core/Factory.php
  class Factory (line 24) | class Factory extends \PasswordLib\Core\AbstractFactory {
    method init (line 28) | public static function init() {}
    method __construct (line 30) | public function __construct(array $callbacks = array()) {
    method __call (line 34) | public function __call($name, array $args = array()) {
    method registerType (line 41) | public function registerType($a1, $a2, $a3, $a4, $a5 = false) {
    method loadFiles (line 45) | public function loadFiles($dir, $name, $method) {

FILE: test/Mocks/Core/Strength.php
  class Strength (line 24) | class Strength extends \PasswordLib\Core\Strength {

FILE: test/Mocks/Key/Derivation/PBKDF.php
  class PBKDF (line 29) | class PBKDF
    method derive (line 44) | public function derive($password, $salt, $iterations, $length) {
    method getSignature (line 56) | public function getSignature() {

FILE: test/Mocks/Random/Generator.php
  class Generator (line 29) | class Generator extends \PasswordLib\Random\Generator {
    method init (line 32) | public static function init() {}
    method __construct (line 34) | public function __construct(array $callbacks = array()) {
    method __call (line 38) | public function __call($name, array $args = array()) {
    method addSource (line 45) | public function addSource(\PasswordLib\Random\Source $source) {
    method generate (line 49) | public function generate($size) {
    method generateInt (line 53) | public function generateInt($min = 0, $max = \PHP_INT_MAX) {
    method generateString (line 57) | public function generateString($length, $chars = '') {

FILE: test/Mocks/Random/Mixer.php
  class Mixer (line 30) | class Mixer extends \PasswordLibTest\Mocks\AbstractMock implements \Pass...
    method init (line 36) | public static function init() {
    method getStrength (line 46) | public static function getStrength() {
    method test (line 55) | public static function test() {
    method mix (line 68) | public function mix(array $parts) {

FILE: test/Mocks/Random/Source.php
  class Source (line 30) | class Source extends \PasswordLibTest\Mocks\AbstractMock implements \Pas...
    method init (line 34) | public static function init() {
    method getStrength (line 43) | public static function getStrength() {
    method generate (line 58) | public function generate($size) {

FILE: test/Unit/Core/AbstractFactoryTest.php
  class Unit_Core_AbstractFactoryTest (line 7) | class Unit_Core_AbstractFactoryTest extends PHPUnit_Framework_TestCase {
    method setUp (line 9) | protected function setUp() {
    method testRegisterType (line 25) | public function testRegisterType() {
    method testRegisterTypeFail (line 34) | public function testRegisterTypeFail() {
    method testRegisterTypeInstantiate (line 42) | public function testRegisterTypeInstantiate() {
    method testLoadFiles (line 47) | public function testLoadFiles() {

FILE: test/Unit/Core/BaseConverterTest.php
  class Unit_Core_BaseConverterTest (line 5) | class Unit_Core_BaseConverterTest extends PHPUnit_Framework_TestCase {
    method provideConvertFromBinary (line 7) | public static function provideConvertFromBinary() {
    method provideConvertToFromBinary (line 17) | public static function provideConvertToFromBinary() {
    method testConvertFromBinary (line 32) | public function testConvertFromBinary($from, $to, $expect) {
    method testConvertToBinary (line 42) | public function testConvertToBinary($expect, $from, $str) {
    method testConvertToAndFromBinary (line 55) | public function testConvertToAndFromBinary($str, $from) {
    method testBaseConvertFailure (line 66) | public function testBaseConvertFailure() {

FILE: test/Unit/Core/BigMath/BCMathTest.php
  class Unit_Core_BigMath_BCMathTest (line 5) | class Unit_Core_BigMath_BCMathTest extends Unit_Core_BigMathTest {
    method setUp (line 9) | protected function setUp() {
    method testAdd (line 18) | public function testAdd($left, $right, $expected) {
    method testSubtract (line 26) | public function testSubtract($left, $right, $expected) {

FILE: test/Unit/Core/BigMath/GMPTest.php
  class Unit_Core_BigMath_GMPTest (line 5) | class Unit_Core_BigMath_GMPTest extends Unit_Core_BigMathTest {
    method setUp (line 9) | protected function setUp() {
    method testAdd (line 18) | public function testAdd($left, $right, $expected) {
    method testSubtract (line 26) | public function testSubtract($left, $right, $expected) {

FILE: test/Unit/Core/BigMath/PHPMathTest.php
  class Unit_Core_BigMath_PHPMathTest (line 5) | class Unit_Core_BigMath_PHPMathTest extends Unit_Core_BigMathTest {
    method testAdd (line 12) | public function testAdd($left, $right, $expected) {
    method testSubtract (line 20) | public function testSubtract($left, $right, $expected) {

FILE: test/Unit/Core/BigMathTest.php
  class Unit_Core_BigMathTest (line 3) | class Unit_Core_BigMathTest extends PHPUnit_Framework_TestCase {
    method provideAddTest (line 7) | public static function provideAddTest() {
    method provideSubtractTest (line 22) | public static function provideSubtractTest() {
    method testCreateFromServerConfiguration (line 36) | public function testCreateFromServerConfiguration() {

FILE: test/Unit/Core/EnumTest.php
  class Unit_Core_EnumTest (line 5) | class Unit_Core_EnumTest extends PHPUnit_Framework_TestCase {
    method provideTestCompare (line 7) | public static function provideTestCompare() {
    method testConstructFail (line 18) | public function testConstructFail() {
    method testConstruct (line 21) | public function testConstruct() {
    method testToString (line 26) | public function testToString() {
    method testCompare (line 35) | public function testCompare(Enum $from, Enum $to, $expected) {
    method testGetConstList (line 39) | public function testGetConstList() {
    method testGetConstListWithDefault (line 50) | public function testGetConstListWithDefault() {

FILE: test/Unit/Core/StrengthTest.php
  class Unit_Core_StrengthTest (line 5) | class Unit_Core_StrengthTest extends PHPUnit_Framework_TestCase {
    method testConstruct (line 7) | public function testConstruct() {
    method testGetConstList (line 13) | public function testGetConstList() {
    method testGetConstListWithDefault (line 24) | public function testGetConstListWithDefault() {

FILE: test/Unit/Hash/HashTest.php
  class Unit_Hash_HashTest (line 5) | class Unit_Hash_HashTest extends PHPUnit_Framework_TestCase {
    method provideTestOutputSize (line 8) | public static function provideTestOutputSize() {
    method testOutputSize (line 19) | public function testOutputSize($algo, $expected) {
    method testGetBlockSize (line 24) | public function testGetBlockSize() {
    method testGetBlockSizeDefault (line 28) | public function testGetBlockSizeDefault() {
    method testGetBlockSizeInBits (line 32) | public function testGetBlockSizeInBits() {
    method testGetBlockSizeInBitsDefault (line 36) | public function testGetBlockSizeInBitsDefault() {
    method testGetHashSize (line 40) | public function testGetHashSize() {
    method testGetHashSizeDefault (line 44) | public function testGetHashSizeDefault() {
    method testGetHashSizeInBits (line 48) | public function testGetHashSizeInBits() {
    method testGetHashSizeInBitsDefault (line 52) | public function testGetHashSizeInBitsDefault() {
    method testIsAvailable (line 56) | public function testIsAvailable() {
    method testIsSecure (line 60) | public function testIsSecure() {
    method testIsSecureDefault (line 64) | public function testIsSecureDefault() {
    method setUp (line 68) | public function setUp() {
    method tearDown (line 81) | public function tearDown() {

FILE: test/Unit/Key/Derivation/PBKDF/PBKDF2Test.php
  class Unit_Key_Derivation_PBKDF_PBKDF2Test (line 5) | class Unit_Key_Derivation_PBKDF_PBKDF2Test extends PHPUnit_Framework_Tes...
    method provideTestDerive (line 7) | public static function provideTestDerive() {
    method testConstruct (line 18) | public function testConstruct() {
    method testDerive (line 28) | public function testDerive($p, $s, $c, $len, $hash, $expect) {
    method testGetSignature (line 37) | public function testGetSignature() {

FILE: test/Unit/Key/FactoryTest.php
  class Unit_Key_FactoryTest (line 5) | class Unit_Key_FactoryTest extends PHPUnit_Framework_TestCase {
    method testConstruct (line 7) | public function testConstruct() {
    method testGetPBKDF (line 11) | public function testGetPBKDF() {
    method testGetPBKDFFail (line 19) | public function testGetPBKDFFail() {

FILE: test/Unit/Password/FactoryTest.php
  class Unit_Password_FactoryTest (line 6) | class Unit_Password_FactoryTest extends PHPUnit_Framework_TestCase {
    method provideTestCreate (line 8) | public static function provideTestCreate() {
    method testConstruct (line 19) | public function testConstruct() {
    method testCreate (line 26) | public function testCreate($algo, $size) {
    method testCreateFailure (line 35) | public function testCreateFailure() {
    method testCreateFailure2 (line 43) | public function testCreateFailure2() {
    method testCreateThenVerify (line 51) | public function testCreateThenVerify($algo) {
    method testVerifyFailure (line 60) | public function testVerifyFailure() {
    method testVerifyMD5 (line 65) | public function testVerifyMD5() {
    method testVerifySHA1 (line 70) | public function testVerifySHA1() {
    method testVerifySHA256 (line 75) | public function testVerifySHA256() {
    method testVerifySHA512 (line 80) | public function testVerifySHA512() {

FILE: test/Unit/Password/Implementation/APR1Test.php
  class Unit_Hash_Implementation_APR1Test (line 11) | class Unit_Hash_Implementation_APR1Test extends Unit_Password_Implementa...
    method provideTestCreate (line 15) | public static function provideTestCreate() {
    method provideTestVerify (line 21) | public static function provideTestVerify() {
    method provideTestVerifyFail (line 27) | public static function provideTestVerifyFail() {
    method provideTestDetect (line 35) | public static function provideTestDetect() {
    method testGetPrefix (line 43) | public function testGetPrefix() {
    method testDetect (line 51) | public function testDetect($from, $expect) {
    method testLoadFromHash (line 58) | public function testLoadFromHash() {
    method testLoadFromHashFail (line 67) | public function testLoadFromHashFail() {
    method testConstruct (line 74) | public function testConstruct() {
    method testConstructArgs (line 82) | public function testConstructArgs() {
    method testCreate (line 96) | public function testCreate($pass, $expect) {
    method testVerify (line 109) | public function testVerify($pass, $expect) {
    method testVerifyFail (line 118) | public function testVerifyFail($pass, $expect) {
    method getAPR1MockInstance (line 123) | protected function getAPR1MockInstance() {
    method getAPR1Instance (line 130) | protected function getAPR1Instance($evaluate, $hmac, $generate) {
    method getRandomGenerator (line 135) | protected function getRandomGenerator($generate) {

FILE: test/Unit/Password/Implementation/BlowfishTest.php
  class Unit_Password_Implementation_BlowfishTest (line 11) | class Unit_Password_Implementation_BlowfishTest extends Unit_Password_Im...
    method provideTestDetect (line 15) | public static function provideTestDetect() {
    method provideTestCreate (line 27) | public static function provideTestCreate() {
    method provideTestVerifyFail (line 35) | public static function provideTestVerifyFail() {
    method provideTestVerifyFailException (line 43) | public static function provideTestVerifyFailException() {
    method testGetPrefix (line 51) | public function testGetPrefix() {
    method testDetect (line 63) | public function testDetect($from, $expect) {
    method testLoadFromHash (line 70) | public function testLoadFromHash() {
    method testLoadFromHashFail (line 79) | public function testLoadFromHashFail() {
    method testConstruct (line 86) | public function testConstruct() {
    method testConstructArgs (line 94) | public function testConstructArgs() {
    method testConstructFailFail (line 105) | public function testConstructFailFail() {
    method testCreateAndVerify (line 112) | public function testCreateAndVerify() {
    method testCreate (line 122) | public function testCreate($iterations, $pass, $expect) {
    method testVerify (line 131) | public function testVerify($iterations, $pass, $expect) {
    method testVerifyFail (line 140) | public function testVerifyFail($iterations, $pass, $expect) {
    method testVerifyFailException (line 150) | public function testVerifyFailException($iterations, $pass, $expect) {
    method getBlowfishMockInstance (line 155) | protected function getBlowfishMockInstance($iterations) {
    method getBlowfishInstance (line 162) | protected function getBlowfishInstance($evaluate, $hmac, $generate) {
    method getRandomGenerator (line 167) | protected function getRandomGenerator($generate) {

FILE: test/Unit/Password/Implementation/CryptTest.php
  class Unit_Password_Implementation_CryptTest (line 11) | class Unit_Password_Implementation_CryptTest extends Unit_Password_Imple...
    method provideTestDetect (line 15) | public static function provideTestDetect() {
    method provideTestCreate (line 27) | public static function provideTestCreate() {
    method provideTestVerifyFail (line 35) | public static function provideTestVerifyFail() {
    method provideTestVerifyFailException (line 43) | public static function provideTestVerifyFailException() {
    method testGetPrefix (line 51) | public function testGetPrefix() {
    method testDetect (line 59) | public function testDetect($from, $expect) {
    method testLoadFromHash (line 66) | public function testLoadFromHash() {
    method testLoadFromHashFail (line 75) | public function testLoadFromHashFail() {
    method testConstruct (line 82) | public function testConstruct() {
    method testConstructArgs (line 90) | public function testConstructArgs() {
    method testCreateAndVerify (line 100) | public function testCreateAndVerify() {
    method testCreate (line 110) | public function testCreate($iterations, $pass, $expect) {
    method testVerify (line 119) | public function testVerify($iterations, $pass, $expect) {
    method testVerifyFail (line 128) | public function testVerifyFail($iterations, $pass, $expect) {
    method testVerifyFailException (line 138) | public function testVerifyFailException($iterations, $pass, $expect) {
    method getCryptMockInstance (line 143) | protected function getCryptMockInstance($iterations) {
    method getCryptInstance (line 150) | protected function getCryptInstance($evaluate, $hmac, $generate) {
    method getRandomGenerator (line 155) | protected function getRandomGenerator($generate) {

FILE: test/Unit/Password/Implementation/DrupalTest.php
  class Unit_Hash_Implementation_DrupalTest (line 9) | class Unit_Hash_Implementation_DrupalTest extends Unit_Password_Implemen...
    method provideTestDetect (line 13) | public static function provideTestDetect() {
    method provideTestCreate (line 25) | public static function provideTestCreate() {
    method provideTestVerifyFail (line 33) | public static function provideTestVerifyFail() {
    method provideTestVerifyFailException (line 41) | public static function provideTestVerifyFailException() {
    method testDetect (line 53) | public function testDetect($from, $expect) {
    method testLoadFromHash (line 60) | public function testLoadFromHash() {
    method testLoadFromHashFail (line 69) | public function testLoadFromHashFail() {
    method testGetPrefix (line 76) | public function testGetPrefix() {
    method testConstruct (line 83) | public function testConstruct() {
    method testConstructArgs (line 91) | public function testConstructArgs() {
    method testConstructFailFail (line 102) | public function testConstructFailFail() {
    method testCreateAndVerify (line 109) | public function testCreateAndVerify() {
    method testCreate (line 119) | public function testCreate($iterations, $pass, $expect) {
    method testVerify (line 128) | public function testVerify($iterations, $pass, $expect) {
    method testVerifyFail (line 137) | public function testVerifyFail($iterations, $pass, $expect) {
    method testVerifyFailException (line 147) | public function testVerifyFailException($iterations, $pass, $expect) {
    method getDrupalMockInstance (line 152) | protected function getDrupalMockInstance($iterations) {
    method getDrupalInstance (line 159) | protected function getDrupalInstance($evaluate, $hmac, $generate) {
    method getRandomGenerator (line 164) | protected function getRandomGenerator($generate) {

FILE: test/Unit/Password/Implementation/HashTest.php
  class Unit_Password_Implementation_HashTest (line 9) | class Unit_Password_Implementation_HashTest extends Unit_Password_Implem...
    method provideTestLoadFromHash (line 13) | public static function provideTestLoadFromHash() {
    method provideTestDetect (line 22) | public static function provideTestDetect() {
    method provideTestVerify (line 34) | public static function provideTestVerify() {
    method provideTestVerifyFail (line 43) | public static function provideTestVerifyFail() {
    method testCreateTypes (line 54) | public function testCreateTypes($password, $valid) {
    method testVerifyTypes (line 61) | public function testVerifyTypes($password, $valid) {
    method testDetect (line 73) | public function testDetect($from, $expect) {
    method testLoadFromHash (line 81) | public function testLoadFromHash($algo) {
    method testLoadFromHashFail (line 90) | public function testLoadFromHashFail() {
    method testConstruct (line 97) | public function testConstruct() {
    method testGetPrefix (line 105) | public function testGetPrefix() {
    method testConstructArgs (line 113) | public function testConstructArgs() {
    method testCreate (line 123) | public function testCreate() {
    method testVerify (line 132) | public function testVerify($func, $pass, $hash) {
    method testVerifyFail (line 141) | public function testVerifyFail($func, $pass, $expect) {
    method getRandomGenerator (line 146) | protected function getRandomGenerator($generate) {
    method getPassword (line 152) | protected function getPassword($func = 'md5') {

FILE: test/Unit/Password/Implementation/JoomlaTest.php
  class Unit_Hash_Implementation_JoomlaTest (line 9) | class Unit_Hash_Implementation_JoomlaTest extends Unit_Password_Implemen...
    method provideTestDetect (line 13) | public static function provideTestDetect() {
    method provideTestCreate (line 24) | public static function provideTestCreate() {
    method provideTestVerifyFail (line 32) | public static function provideTestVerifyFail() {
    method provideTestVerifyFailException (line 40) | public static function provideTestVerifyFailException() {
    method testDetect (line 51) | public function testDetect($from, $expect) {
    method testLoadFromHash (line 58) | public function testLoadFromHash() {
    method testLoadFromHashFail (line 67) | public function testLoadFromHashFail() {
    method testGetPrefix (line 74) | public function testGetPrefix() {
    method testConstruct (line 81) | public function testConstruct() {
    method testConstructArgs (line 89) | public function testConstructArgs() {
    method testCreateAndVerify (line 98) | public function testCreateAndVerify() {
    method testCreate (line 108) | public function testCreate($pass, $expect) {
    method testVerify (line 117) | public function testVerify($pass, $expect) {
    method testVerifyFail (line 126) | public function testVerifyFail($pass, $expect) {
    method testVerifyFailException (line 136) | public function testVerifyFailException($pass, $expect) {
    method getJoomlaMockInstance (line 141) | protected function getJoomlaMockInstance() {
    method getJoomlaInstance (line 148) | protected function getJoomlaInstance($evaluate, $hmac, $generate) {
    method getRandomGenerator (line 153) | protected function getRandomGenerator($generate) {

FILE: test/Unit/Password/Implementation/PBKDFTest.php
  class Unit_Hash_Implementation_PBKDFTest (line 11) | class Unit_Hash_Implementation_PBKDFTest extends Unit_Password_Implement...
    method provideTestDetect (line 15) | public static function provideTestDetect() {
    method provideTestCreate (line 23) | public static function provideTestCreate() {
    method provideTestVerifyFail (line 30) | public static function provideTestVerifyFail() {
    method testLoadFromHashFail (line 54) | public function testLoadFromHashFail() {
    method testLoadFromHashFail2 (line 61) | public function testLoadFromHashFail2() {
    method testGetPrefix (line 65) | public function testGetPrefix() {
    method testDetect (line 73) | public function testDetect($from, $expected) {
    method testConstructWithoutArgs (line 80) | public function testConstructWithoutArgs() {
    method testConstructWithArgs (line 88) | public function testConstructWithArgs() {
    method testCreate (line 100) | public function testCreate($password, $expect) {
    method testVerify (line 130) | public function testVerify($password, $expect) {
    method testVerifyFail (line 159) | public function testVerifyFail($password, $expect) {

FILE: test/Unit/Password/Implementation/PHPASSTest.php
  class Unit_Hash_Implementation_PHPAssTest (line 9) | class Unit_Hash_Implementation_PHPAssTest extends Unit_Password_Implemen...
    method provideTestDetect (line 13) | public static function provideTestDetect() {
    method provideTestCreate (line 23) | public static function provideTestCreate() {
    method provideTestVerifyFail (line 31) | public static function provideTestVerifyFail() {
    method provideTestVerifyFailException (line 39) | public static function provideTestVerifyFailException() {
    method testDetect (line 51) | public function testDetect($from, $expect) {
    method testLoadFromHash (line 58) | public function testLoadFromHash() {
    method testLoadFromHashFail (line 67) | public function testLoadFromHashFail() {
    method testConstruct (line 74) | public function testConstruct() {
    method testConstructArgs (line 82) | public function testConstructArgs() {
    method testConstructFailFail (line 93) | public function testConstructFailFail() {
    method testGetPrefix (line 97) | public function testGetPrefix() {
    method testCreate (line 105) | public function testCreate($iterations, $pass, $expect) {
    method testCreateAndVerify (line 115) | public function testCreateAndVerify() {
    method testVerify (line 125) | public function testVerify($iterations, $pass, $expect) {
    method testVerifyFail (line 134) | public function testVerifyFail($iterations, $pass, $expect) {
    method testVerifyFailException (line 144) | public function testVerifyFailException($iterations, $pass, $expect) {
    method getPHPASSMockInstance (line 149) | protected function getPHPASSMockInstance($iterations) {
    method getPHPASSInstance (line 156) | protected function getPHPASSInstance($evaluate, $hmac, $generate) {
    method getRandomGenerator (line 161) | protected function getRandomGenerator($generate) {

FILE: test/Unit/Password/Implementation/PHPBBTest.php
  class Unit_Password_Implementation_PHPBBTest (line 9) | class Unit_Password_Implementation_PHPBBTest extends Unit_Password_Imple...
    method provideTestDetect (line 13) | public static function provideTestDetect() {
    method provideTestCreate (line 23) | public static function provideTestCreate() {
    method provideTestVerifyFail (line 31) | public static function provideTestVerifyFail() {
    method provideTestVerifyFailException (line 39) | public static function provideTestVerifyFailException() {
    method testDetect (line 51) | public function testDetect($from, $expect) {
    method testLoadFromHash (line 58) | public function testLoadFromHash() {
    method testLoadFromHashFail (line 67) | public function testLoadFromHashFail() {
    method testConstruct (line 74) | public function testConstruct() {
    method testConstructArgs (line 82) | public function testConstructArgs() {
    method testConstructFailFail (line 93) | public function testConstructFailFail() {
    method testGetPrefix (line 97) | public function testGetPrefix() {
    method testCreate (line 105) | public function testCreate($iterations, $pass, $expect) {
    method testCreateAndVerify (line 113) | public function testCreateAndVerify() {
    method testVerify (line 123) | public function testVerify($iterations, $pass, $expect) {
    method testVerifyFail (line 132) | public function testVerifyFail($iterations, $pass, $expect) {
    method testVerifyFailException (line 142) | public function testVerifyFailException($iterations, $pass, $expect) {
    method getPHPBBMockInstance (line 147) | protected function getPHPBBMockInstance($iterations) {
    method getPHPBBInstance (line 154) | protected function getPHPBBInstance($evaluate, $hmac, $generate) {
    method getRandomGenerator (line 159) | protected function getRandomGenerator($generate) {

FILE: test/Unit/Password/Implementation/Password_TestCase.php
  class Unit_Password_Implementation_Password_TestCase (line 3) | class Unit_Password_Implementation_Password_TestCase extends PHPUnit_Fra...
    method provideCreateTypes (line 7) | public static function provideCreateTypes() {
    method testCreateTypes (line 22) | public function testCreateTypes($password, $valid) {
    method testVerifyTypes (line 32) | public function testVerifyTypes($password, $valid) {
    method getPassword (line 41) | protected function getPassword() {
  class CastTestCase (line 51) | class CastTestCase {
    method __toString (line 52) | public function __toString() {

FILE: test/Unit/Password/Implementation/SHA256Test.php
  class Unit_Password_Implementation_SHA256Test (line 11) | class Unit_Password_Implementation_SHA256Test extends Unit_Password_Impl...
    method provideTestDetect (line 15) | public static function provideTestDetect() {
    method provideTestCreate (line 27) | public static function provideTestCreate() {
    method provideTestVerifyFail (line 35) | public static function provideTestVerifyFail() {
    method provideTestVerifyFailException (line 43) | public static function provideTestVerifyFailException() {
    method testGetPrefix (line 51) | public function testGetPrefix() {
    method testDetect (line 59) | public function testDetect($from, $expect) {
    method testLoadFromHash (line 66) | public function testLoadFromHash() {
    method testLoadFromHashFail (line 75) | public function testLoadFromHashFail() {
    method testConstruct (line 82) | public function testConstruct() {
    method testConstructArgs (line 90) | public function testConstructArgs() {
    method testConstructFailFail (line 100) | public function testConstructFailFail() {
    method testCreateAndVerify (line 107) | public function testCreateAndVerify() {
    method testCreate (line 117) | public function testCreate($iterations, $pass, $expect) {
    method testVerify (line 126) | public function testVerify($iterations, $pass, $expect) {
    method testVerifyFail (line 135) | public function testVerifyFail($iterations, $pass, $expect) {
    method testVerifyFailException (line 145) | public function testVerifyFailException($iterations, $pass, $expect) {
    method getSHA256MockInstance (line 150) | protected function getSHA256MockInstance($iterations) {
    method getSHA256Instance (line 157) | protected function getSHA256Instance($evaluate, $hmac, $generate) {
    method getRandomGenerator (line 162) | protected function getRandomGenerator($generate) {

FILE: test/Unit/Password/Implementation/SHA512Test.php
  class Unit_Password_Implementation_SHA512Test (line 11) | class Unit_Password_Implementation_SHA512Test extends Unit_Password_Impl...
    method provideTestDetect (line 15) | public static function provideTestDetect() {
    method provideTestCreate (line 27) | public static function provideTestCreate() {
    method provideTestVerifyFail (line 35) | public static function provideTestVerifyFail() {
    method provideTestVerifyFailException (line 43) | public static function provideTestVerifyFailException() {
    method testGetPrefix (line 51) | public function testGetPrefix() {
    method testDetect (line 59) | public function testDetect($from, $expect) {
    method testLoadFromHash (line 66) | public function testLoadFromHash() {
    method testLoadFromHashFail (line 75) | public function testLoadFromHashFail() {
    method testConstruct (line 82) | public function testConstruct() {
    method testConstructArgs (line 90) | public function testConstructArgs() {
    method testConstructFailFail (line 101) | public function testConstructFailFail() {
    method testCreateAndVerify (line 108) | public function testCreateAndVerify() {
    method testCreate (line 118) | public function testCreate($iterations, $pass, $expect) {
    method testVerify (line 127) | public function testVerify($iterations, $pass, $expect) {
    method testVerifyFail (line 136) | public function testVerifyFail($iterations, $pass, $expect) {
    method testVerifyFailException (line 146) | public function testVerifyFailException($iterations, $pass, $expect) {
    method getSHA512MockInstance (line 151) | protected function getSHA512MockInstance($iterations) {
    method getSHA512Instance (line 158) | protected function getSHA512Instance($evaluate, $hmac, $generate) {
    method getRandomGenerator (line 163) | protected function getRandomGenerator($generate) {

FILE: test/Unit/PasswordLibTest.php
  class Unit_PasswordLibTest (line 6) | class Unit_PasswordLibTest extends PHPUnit_Framework_TestCase {
    method testConstruct (line 8) | public function testConstruct() {
    method testCreatePasswordHash (line 12) | public function testCreatePasswordHash() {
    method testVerifyPasswordHash (line 20) | public function testVerifyPasswordHash() {
    method testGetRandomArrayElement (line 28) | public function testGetRandomArrayElement() {
    method testGetRandomNumber (line 35) | public function testGetRandomNumber() {
    method testGetRandomBytes (line 44) | public function testGetRandomBytes() {
    method testGetRandomToken (line 50) | public function testGetRandomToken() {
    method testShuffleArray (line 56) | public function testShuffleArray() {
    method testShuffleString (line 64) | public function testShuffleString() {

FILE: test/Unit/Random/FactoryTest.php
  class Unit_Random_FactoryTest (line 10) | class Unit_Random_FactoryTest extends PHPUnit_Framework_TestCase {
    method testConstruct (line 19) | public function testConstruct() {
    method testGetGeneratorFallback (line 27) | public function testGetGeneratorFallback() {
    method testGetGeneratorFallbackFail (line 41) | public function testGetGeneratorFallbackFail() {
    method testRegisterSource (line 50) | public function testRegisterSource() {
    method testRegisterSourceFail (line 62) | public function testRegisterSourceFail() {
    method testRegisterMixer (line 72) | public function testRegisterMixer() {
    method testRegisterMixerFail (line 84) | public function testRegisterMixerFail() {
    method testGetMediumStrengthGenerator (line 94) | public function testGetMediumStrengthGenerator() {

FILE: test/Unit/Random/GeneratorTest.php
  class Unit_Random_GeneratorTest (line 8) | class Unit_Random_GeneratorTest extends PHPUnit_Framework_TestCase {
    method provideGenerate (line 12) | public static function provideGenerate() {
    method provideGenerateInt (line 22) | public static function provideGenerateInt() {
    method provideGenerateIntRangeTest (line 37) | public static function provideGenerateIntRangeTest() {
    method provideGenerateStringTest (line 46) | public static function provideGenerateStringTest() {
    method setUp (line 59) | public function setUp() {
    method testConstruct (line 98) | public function testConstruct() {
    method testGetMixer (line 106) | public function testGetMixer() {
    method testGetSources (line 115) | public function testGetSources() {
    method testAddSource (line 125) | public function testAddSource() {
    method testGenerate (line 140) | public function testGenerate($size, $expect) {
    method testGenerateInt (line 148) | public function testGenerateInt($min, $max, $expect) {
    method testGenerateIntRange (line 156) | public function testGenerateIntRange($min, $max) {
    method testGenerateIntFail (line 166) | public function testGenerateIntFail() {
    method testGenerateIntLargeTest (line 173) | public function testGenerateIntLargeTest() {
    method testGenerateString (line 188) | public function testGenerateString($length, $chars, $expected) {

FILE: test/Unit/Random/Mixer/HashTest.php
  class Unit_Random_Mixer_HashTest (line 6) | class Unit_Random_Mixer_HashTest extends PHPUnit_Framework_TestCase {
    method provideMix (line 8) | public static function provideMix() {
    method testConstructWithoutArgument (line 28) | public function testConstructWithoutArgument() {
    method testGetStrength (line 37) | public function testGetStrength() {
    method testTest (line 47) | public function testTest() {
    method testMix (line 57) | public function testMix($parts, $result) {

FILE: test/Unit/Random/Source/CAPICOMTest.php
  class Unit_Random_Source_CAPICOMTest (line 8) | class Unit_Random_Source_CAPICOMTest extends PHPUnit_Framework_TestCase {
    method provideGenerate (line 10) | public static function provideGenerate() {
    method testGetStrength (line 22) | public function testGetStrength() {
    method testGenerate (line 33) | public function testGenerate($length, $not) {

FILE: test/Unit/Random/Source/MTRandTest.php
  class Unit_Random_Source_MTRandTest (line 8) | class Unit_Random_Source_MTRandTest extends PHPUnit_Framework_TestCase {
    method provideGenerate (line 10) | public static function provideGenerate() {
    method testGetStrength (line 22) | public function testGetStrength() {
    method testGenerate (line 36) | public function testGenerate($length, $not) {

FILE: test/Unit/Random/Source/MicroTimeTest.php
  class Unit_Random_Source_MicroTimeTest (line 8) | class Unit_Random_Source_MicroTimeTest extends PHPUnit_Framework_TestCase {
    method provideGenerate (line 10) | public static function provideGenerate() {
    method testGetStrength (line 22) | public function testGetStrength() {
    method testGenerate (line 32) | public function testGenerate($length, $not) {

FILE: test/Unit/Random/Source/RandTest.php
  class Unit_Random_Source_RandTest (line 6) | class Unit_Random_Source_RandTest extends PHPUnit_Framework_TestCase {
    method provideGenerate (line 8) | public static function provideGenerate() {
    method testGetStrength (line 20) | public function testGetStrength() {
    method testGenerate (line 34) | public function testGenerate($length, $not) {

FILE: test/Unit/Random/Source/URandomTest.php
  class Unit_Random_Source_URandomTest (line 9) | class Unit_Random_Source_URandomTest extends PHPUnit_Framework_TestCase {
    method provideGenerate (line 11) | public static function provideGenerate() {
    method testGetStrength (line 23) | public function testGetStrength() {
    method testGenerate (line 34) | public function testGenerate($length, $not) {

FILE: test/Unit/Random/Source/UniqIDTest.php
  class Unit_Random_Source_UniqIDTest (line 8) | class Unit_Random_Source_UniqIDTest extends PHPUnit_Framework_TestCase {
    method provideGenerate (line 10) | public static function provideGenerate() {
    method testGetStrength (line 22) | public function testGetStrength() {
    method testGenerate (line 32) | public function testGenerate($length, $not) {

FILE: test/Vectors/Key/Derivation/PBKDF/PBKDF2Test.php
  class Vectors_Key_Derivation_PBKDF_PBKDF2Test (line 6) | class Vectors_Key_Derivation_PBKDF_PBKDF2Test extends PHPUnit_Framework_...
    method provideTestDerive (line 8) | public static function provideTestDerive() {
    method testDerive (line 36) | public function testDerive($p, $s, $c, $len, $hash, $expect) {

FILE: test/Vectors/Password/Implementation/APR1Test.php
  class Vectors_Password_Implementation_APR1Test (line 5) | class Vectors_Password_Implementation_APR1Test extends PHPUnit_Framework...
    method provideTestVerify (line 7) | public static function provideTestVerify() {
    method testVerify (line 39) | public function testVerify($pass, $expect, $value) {

FILE: test/Vectors/Password/Implementation/BlowfishTest.php
  class Vectors_Password_Implementation_BlowfishTest (line 5) | class Vectors_Password_Implementation_BlowfishTest extends PHPUnit_Frame...
    method provideTestVerify (line 7) | public static function provideTestVerify() {
    method testVerify (line 26) | public function testVerify($pass, $expect, $value) {

FILE: test/Vectors/Password/Implementation/DrupalTest.php
  class Vectors_Password_Implementation_DrupalTest (line 5) | class Vectors_Password_Implementation_DrupalTest extends PHPUnit_Framewo...
    method provideTestVerify (line 7) | public static function provideTestVerify() {
    method testVerify (line 26) | public function testVerify($pass, $expect, $value) {

FILE: test/Vectors/Password/Implementation/PBKDFTest.php
  class Vectors_Password_Implementation_PBKDFTest (line 5) | class Vectors_Password_Implementation_PBKDFTest extends PHPUnit_Framewor...
    method provideTestVerify (line 7) | public static function provideTestVerify() {
    method testVerify (line 26) | public function testVerify($pass, $expect, $value) {

FILE: test/Vectors/Password/Implementation/PHPASSTest.php
  class Vectors_Password_Implementation_PHPASSTest (line 5) | class Vectors_Password_Implementation_PHPASSTest extends PHPUnit_Framewo...
    method provideTestVerify (line 7) | public static function provideTestVerify() {
    method testVerify (line 26) | public function testVerify($pass, $expect, $value) {

FILE: test/Vectors/Password/Implementation/PHPBBTest.php
  class Vectors_Password_Implementation_PHPBBTest (line 5) | class Vectors_Password_Implementation_PHPBBTest extends PHPUnit_Framewor...
    method provideTestVerify (line 7) | public static function provideTestVerify() {
    method testVerify (line 26) | public function testVerify($pass, $expect, $value) {

FILE: test/Vectors/Random/GeneratorTest.php
  class Vectors_Random_GeneratorTest (line 8) | class Vectors_Random_GeneratorTest extends PHPUnit_Framework_TestCase {
    method provideGenerateInt (line 10) | public static function provideGenerateInt() {
    method provideGenerators (line 37) | public static function provideGenerators() {
    method testGenerateInt (line 55) | public function testGenerateInt($min, $max, $offset = 0) {
    method testGenerate (line 90) | public function testGenerate(\PasswordLib\Random\Generator $generator,...
    method doTestGenerate (line 106) | protected function doTestGenerate(\PasswordLib\Random\Generator $gener...
    method getGenerator (line 130) | public function getGenerator($random) {

FILE: test/bootstrap.php
  function getTestDataFile (line 48) | function getTestDataFile($file) {

FILE: test/lib/VectorParser/CAVS.php
  class CAVS (line 5) | class CAVS {
    method __construct (line 11) | public function __construct($file) {
    method getVectors (line 16) | public function getVectors() {
    method parse (line 20) | protected function parse() {
    method processBuffer (line 46) | protected function processBuffer(array $buffer) {

FILE: test/lib/VectorParser/NESSIE.php
  class NESSIE (line 5) | class NESSIE {
    method __construct (line 11) | public function __construct($file) {
    method getVectors (line 16) | public function getVectors() {
    method parse (line 20) | protected function parse() {
    method processBuffer (line 36) | protected function processBuffer(array $lines) {

FILE: test/lib/VectorParser/RFC3610.php
  class RFC3610 (line 5) | class RFC3610 {
    method __construct (line 11) | public function __construct($file) {
    method getVectors (line 16) | public function getVectors() {
    method parse (line 20) | protected function parse() {
    method processBuffer (line 38) | protected function processBuffer(array $buffer) {

FILE: test/lib/VectorParser/SSV.php
  class SSV (line 5) | class SSV {
    method __construct (line 11) | public function __construct($file) {
    method getVectors (line 16) | public function getVectors() {
    method parse (line 20) | protected function parse() {
Condensed preview — 144 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (3,345K chars).
[
  {
    "path": ".gitignore",
    "chars": 6,
    "preview": "vendor"
  },
  {
    "path": ".travis.yml",
    "chars": 141,
    "preview": "language: php\n\nphp:\n  - 5.5\n  - 5.4\n  - 5.3\n\nbefore_script:\n  - composer install --dev\n\nscript: phpunit --configuration "
  },
  {
    "path": "README.markdown",
    "chars": 11093,
    "preview": "# PHP-PasswordLib\n\n## Build Status\n\n[![Build Status](https://travis-ci.org/ircmaxell/PHP-PasswordLib.png?branch=master)]"
  },
  {
    "path": "build/.gitignore",
    "chars": 9,
    "preview": "results/\n"
  },
  {
    "path": "build/build.properties",
    "chars": 301,
    "preview": "# Default Paths, DO NOT CHANGE\r\npath.lib=${project.basedir}/lib\r\npath.build=${project.basedir}/build\r\npath.results=${pat"
  },
  {
    "path": "build/build.xml",
    "chars": 874,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project name=\"PHP-PasswordLib\" default=\"build-lite\" basedir=\"../\">\n    <property"
  },
  {
    "path": "build/phar.stub.php",
    "chars": 860,
    "preview": "<?php\n/**\n * Bootstrap the library.  This registers a simple autoloader for autoloading\n * classes\n *\n * If you are usin"
  },
  {
    "path": "build/phing/document.xml",
    "chars": 1008,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project name=\"documentation\" default=\"document\" basedir=\"../../\">\n    <property "
  },
  {
    "path": "build/phing/package.xml",
    "chars": 4437,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project name=\"package\" default=\"package\" basedir=\"../../\">\n    <property file=\"b"
  },
  {
    "path": "build/phing/quality.xml",
    "chars": 2301,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project name=\"quality\" default=\"quality\" basedir=\"../../\">\n    <property file=\"b"
  },
  {
    "path": "build/phing/test.xml",
    "chars": 1993,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project name=\"tests\" default=\"test\" basedir=\"../../\">\n    <property file=\"build/"
  },
  {
    "path": "build/phpcs/ruleset.xml",
    "chars": 1997,
    "preview": "<?xml version=\"1.0\"?>\n<ruleset name=\"PHP-PasswordLib\">\n\t<description>PHP-PasswordLib Standard</description>\n\n\t<rule ref="
  },
  {
    "path": "build/phpmd/ruleset.xml",
    "chars": 1601,
    "preview": "<?xml version=\"1.0\"?>\n<ruleset name=\"PHP-PasswordLib PHPMD Rule Set\"\n         xmlns=\"http://pmd.sf.net/ruleset/1.0.0\"\n  "
  },
  {
    "path": "composer.json",
    "chars": 688,
    "preview": "{\n    \"name\": \"PasswordLib/PasswordLib\",\n    \"type\": \"library\",\n\t\"version\": \"1.0.0-beta1\",\n    \"description\": \"A Passwor"
  },
  {
    "path": "examples/Password/drupal.php",
    "chars": 1652,
    "preview": "<?php\n/**\n * An example file demonstrating the generation and validation of Drupal\n * Passwords (new Style)\n *\n * PHP ve"
  },
  {
    "path": "examples/PasswordLib.php",
    "chars": 5132,
    "preview": "<?php\n/**\n * An example file demonstrating the use of the wrapper class PasswordLib\n *\n * PHP version 5.3\n *\n * @categor"
  },
  {
    "path": "examples/Random/numbers.php",
    "chars": 1879,
    "preview": "<?php\n/**\n * An example file demonstrating the generation of random numbers.\n *\n * PHP version 5.3\n *\n * @category   PHP"
  },
  {
    "path": "examples/Random/strings.php",
    "chars": 2312,
    "preview": "<?php\n/**\n * An example file demonstrating the generation of random strings.\n *\n * PHP version 5.3\n *\n * @category   PHP"
  },
  {
    "path": "lib/PasswordLib/Core/AbstractFactory.php",
    "chars": 2614,
    "preview": "<?php\n/**\n * The base abstract factory used by all PasswordLib factories\n *\n * PHP version 5.3\n *\n * @category  PHPPassw"
  },
  {
    "path": "lib/PasswordLib/Core/AutoLoader.php",
    "chars": 2512,
    "preview": "<?php\n/**\n * An implementation of the PSR-0 Autoloader.  This can be replaced at will with\n * other implementations if n"
  },
  {
    "path": "lib/PasswordLib/Core/BaseConverter.php",
    "chars": 3822,
    "preview": "<?php\n\n/**\n * A Utility class for converting between raw binary strings and a given\n * list of characters\n *\n * PHP vers"
  },
  {
    "path": "lib/PasswordLib/Core/BigMath/BCMath.php",
    "chars": 1259,
    "preview": "<?php\n/**\n * A class for arbitrary precision math functions implemented using bcmath\n *\n * PHP version 5.3\n *\n * @catego"
  },
  {
    "path": "lib/PasswordLib/Core/BigMath/GMP.php",
    "chars": 1275,
    "preview": "<?php\n/**\n * A class for arbitrary precision math functions implemented using GMP\n *\n * PHP version 5.3\n *\n * @category "
  },
  {
    "path": "lib/PasswordLib/Core/BigMath/PHPMath.php",
    "chars": 5120,
    "preview": "<?php\n/**\n * A class for arbitrary precision math functions implemented in PHP\n *\n * PHP version 5.3\n *\n * @category   P"
  },
  {
    "path": "lib/PasswordLib/Core/BigMath.php",
    "chars": 1787,
    "preview": "<?php\n/**\n * A class for arbitrary precision math functions\n *\n * PHP version 5.3\n *\n * @category   PHPPasswordLib\n * @p"
  },
  {
    "path": "lib/PasswordLib/Core/Enum.php",
    "chars": 3293,
    "preview": "<?php\n/**\n * The Enum base class for Enum functionality\n *\n * PHP version 5.3\n *\n * @category   PHPPasswordLib\n * @packa"
  },
  {
    "path": "lib/PasswordLib/Core/Strength.php",
    "chars": 1529,
    "preview": "<?php\n/**\n * The strength FlyweightEnum class\n *\n * PHP version 5.3\n *\n * @category   PHPPasswordLib\n * @package    Core"
  },
  {
    "path": "lib/PasswordLib/Hash/Hash.php",
    "chars": 10534,
    "preview": "<?php\n/**\n * A hash utility data mapper class\n * \n * This class's purpose is to store information about hash algorithms "
  },
  {
    "path": "lib/PasswordLib/Key/Derivation/AbstractDerivation.php",
    "chars": 1276,
    "preview": "<?php\n/**\n * An abstract implementation of some standard key derivation needs\n *\n * PHP version 5.3\n *\n * @category   PH"
  },
  {
    "path": "lib/PasswordLib/Key/Derivation/PBKDF/PBKDF2.php",
    "chars": 2255,
    "preview": "<?php\n/**\n * An implementation of the RFC 2898 PBKDF2 Standard key derivation function\n *\n * PHP version 5.3\n *\n * @see "
  },
  {
    "path": "lib/PasswordLib/Key/Derivation/PBKDF.php",
    "chars": 1655,
    "preview": "<?php\n/**\n * The core PBKDF interface (Password Based Key Derivation Function)\n *\n * This interface must be used to desc"
  },
  {
    "path": "lib/PasswordLib/Key/Factory.php",
    "chars": 2703,
    "preview": "<?php\n/**\n * The core Key Factory\n *\n * PHP version 5.3\n *\n * @category   PHPPasswordLib\n * @package    Key\n * @author  "
  },
  {
    "path": "lib/PasswordLib/Password/AbstractPassword.php",
    "chars": 5675,
    "preview": "<?php\n/**\n * The base abstract password hashing implementation\n *\n * This class provides common functionality to all chi"
  },
  {
    "path": "lib/PasswordLib/Password/Factory.php",
    "chars": 3362,
    "preview": "<?php\n/**\n * The Password Factory\n *\n * PHP version 5.3\n *\n * @category   PHPPasswordLib\n * @package    Password\n * @aut"
  },
  {
    "path": "lib/PasswordLib/Password/Implementation/APR1.php",
    "chars": 5869,
    "preview": "<?php\n/**\n * The APR1 password hashing implementation\n *\n * Use this class to generate and validate APR1 password hashes"
  },
  {
    "path": "lib/PasswordLib/Password/Implementation/Blowfish.php",
    "chars": 3033,
    "preview": "<?php\n/**\n * The Blowfish password hashing implementation\n *\n * Use this class to generate and validate Blowfish passwor"
  },
  {
    "path": "lib/PasswordLib/Password/Implementation/Crypt.php",
    "chars": 4525,
    "preview": "<?php\n/**\n * The Blowfish password hashing implementation\n *\n * Use this class to generate and validate Blowfish passwor"
  },
  {
    "path": "lib/PasswordLib/Password/Implementation/Drupal.php",
    "chars": 1535,
    "preview": "<?php\n/**\n * The Drupal password hashing implementation\n *\n * Use this class to generate and validate Drupal password ha"
  },
  {
    "path": "lib/PasswordLib/Password/Implementation/Hash.php",
    "chars": 3217,
    "preview": "<?php\n/**\n * The basic Hash implementation.\n *\n * It's worth noting, since there's no prefix, you cannot create a hash u"
  },
  {
    "path": "lib/PasswordLib/Password/Implementation/Joomla.php",
    "chars": 3178,
    "preview": "<?php\n/**\n * The Joomla based hash implementation based off of the md5-hex hash method\n *\n * It's worth noting, since th"
  },
  {
    "path": "lib/PasswordLib/Password/Implementation/MD5.php",
    "chars": 1396,
    "preview": "<?php\n/**\n * The Blowfish password hashing implementation\n *\n * Use this class to generate and validate Blowfish passwor"
  },
  {
    "path": "lib/PasswordLib/Password/Implementation/MediaWiki.php",
    "chars": 1927,
    "preview": "<?php\n/**\n * The MediaWiki password hashing implementation\n *\n * Use this class to generate and validate MediaWiki passw"
  },
  {
    "path": "lib/PasswordLib/Password/Implementation/PBKDF.php",
    "chars": 5364,
    "preview": "<?php\n/**\n * The PBKDF based password hashing implementation\n *\n * Use this class to generate and validate PBKDF hashed "
  },
  {
    "path": "lib/PasswordLib/Password/Implementation/PHPASS.php",
    "chars": 6869,
    "preview": "<?php\n/**\n * The PHPASS password hashing implementation\n *\n * Use this class to generate and validate PHPASS password ha"
  },
  {
    "path": "lib/PasswordLib/Password/Implementation/PHPBB.php",
    "chars": 1037,
    "preview": "<?php\n/**\n * The PHPBB password hashing implementation\n *\n * Use this class to generate and validate PHPBB password hash"
  },
  {
    "path": "lib/PasswordLib/Password/Implementation/SHA256.php",
    "chars": 2731,
    "preview": "<?php\n/**\n * The Blowfish password hashing implementation\n *\n * Use this class to generate and validate Blowfish passwor"
  },
  {
    "path": "lib/PasswordLib/Password/Implementation/SHA512.php",
    "chars": 2731,
    "preview": "<?php\n/**\n * The Blowfish password hashing implementation\n *\n * Use this class to generate and validate Blowfish passwor"
  },
  {
    "path": "lib/PasswordLib/Password/Password.php",
    "chars": 1887,
    "preview": "<?php\n/**\n * The core password hash interface\n *\n * All pasword implementations must implement this interface\n *\n * PHP "
  },
  {
    "path": "lib/PasswordLib/PasswordLib.php",
    "chars": 5522,
    "preview": "<?php\n/**\n * A core wrapper class to provide easy access to all of the cryptographic functions\n * contained within the l"
  },
  {
    "path": "lib/PasswordLib/Random/AbstractMixer.php",
    "chars": 3465,
    "preview": "<?php\n/**\n * An abstract mixer to implement a common mixing strategy\n *\n * PHP version 5.3\n *\n * @category  PHPPasswordL"
  },
  {
    "path": "lib/PasswordLib/Random/Factory.php",
    "chars": 6238,
    "preview": "<?php\n/**\n * The Random Factory\n *\n * Use this factory to instantiate random number generators, sources and mixers.\n *\n "
  },
  {
    "path": "lib/PasswordLib/Random/Generator.php",
    "chars": 6826,
    "preview": "<?php\n/**\n * The Random Number Generator Class\n *\n * Use this factory to generate cryptographic quality random numbers ("
  },
  {
    "path": "lib/PasswordLib/Random/Mixer/Hash.php",
    "chars": 2677,
    "preview": "<?php\n/**\n * The Hash medium strength mixer class\n *\n * This class implements a mixer based upon the recommendations in "
  },
  {
    "path": "lib/PasswordLib/Random/Mixer.php",
    "chars": 1348,
    "preview": "<?php\n/**\n * The Mixer strategy interface.\n *\n * All mixing strategies must implement this interface\n *\n * PHP version 5"
  },
  {
    "path": "lib/PasswordLib/Random/Source/CAPICOM.php",
    "chars": 1731,
    "preview": "<?php\n/**\n * The Capicom Random Number Source\n *\n * This uses the Windows CapiCom Com object to generate random numbers\n"
  },
  {
    "path": "lib/PasswordLib/Random/Source/MTRand.php",
    "chars": 1936,
    "preview": "<?php\n/**\n * The MTRand Random Number Source\n *\n * This source generates low strength random numbers by using the intern"
  },
  {
    "path": "lib/PasswordLib/Random/Source/MicroTime.php",
    "chars": 2932,
    "preview": "<?php\n/**\n * The Microtime Random Number Source\n *\n * This uses the current micro-second (looped several times) for a **"
  },
  {
    "path": "lib/PasswordLib/Random/Source/Rand.php",
    "chars": 1919,
    "preview": "<?php\n/**\n * The Rand Random Number Source\n *\n * This source generates low strength random numbers by using the internal"
  },
  {
    "path": "lib/PasswordLib/Random/Source/URandom.php",
    "chars": 1877,
    "preview": "<?php\n/**\n * The URandom Random Number Source\n *\n * This uses the *nix /dev/urandom device to generate medium strength n"
  },
  {
    "path": "lib/PasswordLib/Random/Source/UniqID.php",
    "chars": 1530,
    "preview": "<?php\n/**\n * The UniqID Random Number Source\n *\n * This uses the internal `uniqid()` function to generate low strength r"
  },
  {
    "path": "lib/PasswordLib/Random/Source.php",
    "chars": 1263,
    "preview": "<?php\n/**\n * The Random Number Source interface.\n *\n * All random number sources must implement this interface\n *\n * PHP"
  },
  {
    "path": "lib/PasswordLib/bootstrap.php",
    "chars": 693,
    "preview": "<?php\n/**\n * Bootstrap the library.  This registers a simple autoloader for autoloading\n * classes\n *\n * If you are usin"
  },
  {
    "path": "phpunit.xml.dist",
    "chars": 939,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<phpunit backupGlobals=\"true\"\n         backupStaticAttributes=\"false\"\n         bo"
  },
  {
    "path": "test/Data/Vectors/aes-cbc.test-vectors",
    "chars": 2737,
    "preview": "Primitive Name: AES\n========================\nKey size: Variable\nBlock size: 128 bits\n\nTest vectors -- set 1\n============"
  },
  {
    "path": "test/Data/Vectors/aes-cfb.test-vectors",
    "chars": 2737,
    "preview": "Primitive Name: AES\n========================\nKey size: Variable\nBlock size: 128 bits\n\nTest vectors -- set 1\n============"
  },
  {
    "path": "test/Data/Vectors/aes-ctr.test-vectors",
    "chars": 2735,
    "preview": "Primitive Name: AES\n========================\nKey size: Variable\nBlock size: 128 bits\n\nTest vectors -- set 1\n============"
  },
  {
    "path": "test/Data/Vectors/aes-ecb.test-vectors",
    "chars": 2353,
    "preview": "Primitive Name: AES\n========================\nKey size: Variable\nBlock size: 128 bits\n\nTest vectors -- set 1\n============"
  },
  {
    "path": "test/Data/Vectors/aes-ofb.test-vectors",
    "chars": 2737,
    "preview": "Primitive Name: AES\n========================\nKey size: Variable\nBlock size: 128 bits\n\nTest vectors -- set 1\n============"
  },
  {
    "path": "test/Data/Vectors/apr1.custom.test-vectors",
    "chars": 14154,
    "preview": "test $apr1$WokpW...$sNDO6MucVqOQSmB06k48R0\ntest1 $apr1$INUXn/..$D4tETRyYqquDJyKYiCjfx.\ntest22 $apr1$5lXfE/..$7mAF16euQTZ"
  },
  {
    "path": "test/Data/Vectors/apr1.test-vectors",
    "chars": 742,
    "preview": "Set 1\n    P=foobar\n    H=$apr1$ia4ip/..$2rAEb1KjqPFGEaecm/bbI1\n    Value=1\n\nSet 2\n    P=foobaz\n    H=$apr1$TAAUp/..$fkSY"
  },
  {
    "path": "test/Data/Vectors/blowfish.custom.test-vectors",
    "chars": 16454,
    "preview": "test $2a$08$VYKCMVm0n325S.TcXiC5oe.gtalGcyF8HcQkvDBBFlHSGhbQ7FBWm\ntest1 $2a$08$6HRUqlGXHDalXXLLCb.YIO8YtNtzAzv6823adztvI"
  },
  {
    "path": "test/Data/Vectors/ccm-RFC3610.test-vectors",
    "chars": 9123,
    "preview": "   =============== Packet Vector #1 ==================\r\n   AES Key =  C0C1C2C3C4C5C6C7C8C9CACBCCCDCECF\r\n   Nonce =    00"
  },
  {
    "path": "test/Data/Vectors/ccm-cavs11-dvpt.decryption.test-vectors",
    "chars": 59584,
    "preview": "#  CAVS 11.0\r\n#  \"CCM-DVPT\" information\r\n#  AES Keylen: 128\r\n#  Generated on Tue Mar 15 08:09:25 2011\r\n\r\n\r\n\r\nCount = 0\r\n"
  },
  {
    "path": "test/Data/Vectors/cmac-aes.sp-800-38b.test-vectors",
    "chars": 2793,
    "preview": "Primitive Name: AES\r\n========================\r\nKey size: 128 bits\r\nBlock size: 128 bits\r\n\r\nTest vectors -- set 1\r\n======"
  },
  {
    "path": "test/Data/Vectors/des.test-vectors",
    "chars": 12943,
    "preview": "# Test vectors for DES Electronic Code Book (ECB) \n# implementation, derived from: \n#   \"Validating the Correctness of H"
  },
  {
    "path": "test/Data/Vectors/drupal.custom.test-vectors",
    "chars": 20254,
    "preview": "test $S$6a3AfXYgzi8UBwwAQoe.9XSIKkz7Hn8wz6jdp4B26UJtFXPM.bIU5P0rAV3c7.W6QS3V67RpVQ3Ln7.RymtYW8a1lFuUbC.\ntest1 $S$6Ibgnp0"
  },
  {
    "path": "test/Data/Vectors/hmac.rfc4231.test-vectors",
    "chars": 4764,
    "preview": "#Test Vectors taken from RFC 4231\r\n\r\nSet 1 Vector 1\r\n    Key=0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b\r\n    Data=48692054"
  },
  {
    "path": "test/Data/Vectors/pbkdf.custom.test-vectors",
    "chars": 17854,
    "preview": "test $pbkdf$pbkdf2-sha512$5000$26$KFuMDXmo$yPsu5qmQto99vDqAMWnldNuagfVl5OhPr6g=\ntest1 $pbkdf$pbkdf2-sha512$5000$26$rJBsZ"
  },
  {
    "path": "test/Data/Vectors/pbkdf2-draft-josefsson-sha1.test-vectors",
    "chars": 687,
    "preview": "Set 1\n    P=password\n    S=salt\n    c=1\n    dkLen=20\n    DK=0c60c80f961f0e71f3a9b524af6012062fe037a6\n\nSet 2\n    P=passwo"
  },
  {
    "path": "test/Data/Vectors/pbkdf2-draft-josefsson-sha256.test-vectors",
    "chars": 896,
    "preview": "#PBKDF2 HMAC-SHA256 Test Vectors\n\nSet 1\n    P=password\n    S=salt\n    c=1\n    dkLen=32\n    DK=120fb6cffcf8b32c43e7225256"
  },
  {
    "path": "test/Data/Vectors/phpass.custom.test-vectors",
    "chars": 13854,
    "preview": "test $P$66jVhgwpPvShVWo.AH0AumgGnvxpQS/\ntest1 $P$6o/AWUDSh7ESAeKEYdRh6V2Ao.BWiz.\ntest22 $P$61CNljT4K37Nq9kNC.j5vkzz6sQ3I"
  },
  {
    "path": "test/Data/Vectors/phpbb.custom.test-vectors",
    "chars": 13854,
    "preview": "test $H$61Vy7ok4wSwZS53N0ou/AusELbMUKA1\ntest1 $H$6MqETT/oX31qTKxbFRwwsg5yRGw5tM1\ntest22 $H$6G9B6B9EiPxkP/W/sDOibbcuUjAWY"
  },
  {
    "path": "test/Data/Vectors/rijndael-256-128.unverified.test-vectors",
    "chars": 519452,
    "preview": "********************************************************************************\n*Project NESSIE - New European Schemes "
  },
  {
    "path": "test/Data/Vectors/rijndael-256-192.unverified.test-vectors",
    "chars": 661532,
    "preview": "********************************************************************************\n*Project NESSIE - New European Schemes "
  },
  {
    "path": "test/Data/Vectors/rijndael-256-256.unverified.test-vectors",
    "chars": 1017116,
    "preview": "********************************************************************************\n*Project NESSIE - New European Schemes "
  },
  {
    "path": "test/Data/Vectors/triple-des-2-key-128-64.unverified.test-vectors",
    "chars": 249135,
    "preview": "********************************************************************************\n*Project NESSIE - New European Schemes "
  },
  {
    "path": "test/Data/Vectors/triple-des-3-key-192-64.unverified.test-vectors",
    "chars": 300911,
    "preview": "********************************************************************************\n*Project NESSIE - New European Schemes "
  },
  {
    "path": "test/Mocks/AbstractMock.php",
    "chars": 1024,
    "preview": "<?php\n/**\n * The interface that all hash implementations must implement\n *\n * PHP version 5.3\n *\n * @category   PHPPassw"
  },
  {
    "path": "test/Mocks/Cipher/Block/Cipher.php",
    "chars": 2911,
    "preview": "<?php\n/**\n * The interface that all block ciphers must implement\n *\n * PHP version 5.3\n *\n * @category   PHPPasswordLib\n"
  },
  {
    "path": "test/Mocks/Cipher/Factory.php",
    "chars": 3634,
    "preview": "<?php\n/**\n * The Cipher Factory\n *\n * Use this factory to instantiate ciphers and modes based upon their names. You\n * c"
  },
  {
    "path": "test/Mocks/Core/Enum.php",
    "chars": 742,
    "preview": "<?php\n/**\n * The interface that all hash implementations must implement\n *\n * PHP version 5.3\n *\n * @category   PHPPassw"
  },
  {
    "path": "test/Mocks/Core/Factory.php",
    "chars": 1324,
    "preview": "<?php\n/**\n * The interface that all hash implementations must implement\n *\n * PHP version 5.3\n *\n * @category   PHPPassw"
  },
  {
    "path": "test/Mocks/Core/Strength.php",
    "chars": 714,
    "preview": "<?php\n/**\n * The interface that all hash implementations must implement\n *\n * PHP version 5.3\n *\n * @category   PHPPassw"
  },
  {
    "path": "test/Mocks/Key/Derivation/PBKDF.php",
    "chars": 1768,
    "preview": "<?php\n/**\n * An implementation of the RFC 2898 PBKDF2 Standard key derivation function\n *\n * PHP version 5.3\n *\n * @see "
  },
  {
    "path": "test/Mocks/Random/Generator.php",
    "chars": 1637,
    "preview": "<?php\n/**\n * The Mixer strategy interface.\n *\n * All mixing strategies must implement this interface\n *\n * PHP version 5"
  },
  {
    "path": "test/Mocks/Random/Mixer.php",
    "chars": 1824,
    "preview": "<?php\n/**\n * The Mixer strategy interface.\n *\n * All mixing strategies must implement this interface\n *\n * PHP version 5"
  },
  {
    "path": "test/Mocks/Random/Source.php",
    "chars": 1664,
    "preview": "<?php\n/**\n * The Random Number Source interface.\n *\n * All random number sources must implement this interface\n *\n * PHP"
  },
  {
    "path": "test/Unit/Core/AbstractFactoryTest.php",
    "chars": 1986,
    "preview": "<?php\n\nuse PasswordLibTest\\Mocks\\Core\\Factory;\n\nuse org\\bovigo\\vfs\\vfsStream;\n\nclass Unit_Core_AbstractFactoryTest exten"
  },
  {
    "path": "test/Unit/Core/BaseConverterTest.php",
    "chars": 2259,
    "preview": "<?php\n\nuse PasswordLib\\Core\\BaseConverter;\n\nclass Unit_Core_BaseConverterTest extends PHPUnit_Framework_TestCase {\n\n    "
  },
  {
    "path": "test/Unit/Core/BigMath/BCMathTest.php",
    "chars": 824,
    "preview": "<?php\n\nrequire_once __DIR__ . '/../BigMathTest.php';\n\nclass Unit_Core_BigMath_BCMathTest extends Unit_Core_BigMathTest {"
  },
  {
    "path": "test/Unit/Core/BigMath/GMPTest.php",
    "chars": 816,
    "preview": "<?php\n\nrequire_once __DIR__ . '/../BigMathTest.php';\n\nclass Unit_Core_BigMath_GMPTest extends Unit_Core_BigMathTest {\n  "
  },
  {
    "path": "test/Unit/Core/BigMath/PHPMathTest.php",
    "chars": 674,
    "preview": "<?php\n\nrequire_once __DIR__ . '/../BigMathTest.php';\n\nclass Unit_Core_BigMath_PHPMathTest extends Unit_Core_BigMathTest "
  },
  {
    "path": "test/Unit/Core/BigMathTest.php",
    "chars": 1542,
    "preview": "<?php\n\nclass Unit_Core_BigMathTest extends PHPUnit_Framework_TestCase {\n\n    protected static $mathImplementations = arr"
  },
  {
    "path": "test/Unit/Core/EnumTest.php",
    "chars": 1697,
    "preview": "<?php\n\nuse PasswordLibTest\\Mocks\\Core\\Enum;\n\nclass Unit_Core_EnumTest extends PHPUnit_Framework_TestCase {\n\n    public s"
  },
  {
    "path": "test/Unit/Core/StrengthTest.php",
    "chars": 932,
    "preview": "<?php\n\nuse PasswordLib\\Core\\Strength;\n\nclass Unit_Core_StrengthTest extends PHPUnit_Framework_TestCase {\n\n    public fun"
  },
  {
    "path": "test/Unit/Hash/HashTest.php",
    "chars": 2499,
    "preview": "<?php\n\nuse PasswordLib\\Hash\\Hash;\n\nclass Unit_Hash_HashTest extends PHPUnit_Framework_TestCase {\n    protected $oldHashe"
  },
  {
    "path": "test/Unit/Key/Derivation/PBKDF/PBKDF2Test.php",
    "chars": 1305,
    "preview": "<?php\n\nuse PasswordLib\\Key\\Derivation\\PBKDF\\PBKDF2;\n\nclass Unit_Key_Derivation_PBKDF_PBKDF2Test extends PHPUnit_Framewor"
  },
  {
    "path": "test/Unit/Key/FactoryTest.php",
    "chars": 550,
    "preview": "<?php\n\nuse PasswordLib\\Key\\Factory;\n\nclass Unit_Key_FactoryTest extends PHPUnit_Framework_TestCase {\n\n    public functio"
  },
  {
    "path": "test/Unit/Password/FactoryTest.php",
    "chars": 2224,
    "preview": "<?php\n\nuse PasswordLib\\Password\\Factory;\nuse PasswordLib\\Password\\Implementation\\Blowfish;\n\nclass Unit_Password_FactoryT"
  },
  {
    "path": "test/Unit/Password/Implementation/APR1Test.php",
    "chars": 4410,
    "preview": "<?php\n\nuse PasswordLib\\Core\\Strength\\Medium as MediumStrength;\nuse PasswordLibTest\\Mocks\\Hash\\Hash as MockHash;\nuse Pass"
  },
  {
    "path": "test/Unit/Password/Implementation/BlowfishTest.php",
    "chars": 6294,
    "preview": "<?php\n\nuse PasswordLib\\Core\\Strength\\Medium as MediumStrength;\nuse PasswordLibTest\\Mocks\\Hash\\Hash as MockHash;\nuse Pass"
  },
  {
    "path": "test/Unit/Password/Implementation/CryptTest.php",
    "chars": 5428,
    "preview": "<?php\n\nuse PasswordLib\\Core\\Strength\\Medium as MediumStrength;\nuse PasswordLibTest\\Mocks\\Hash\\Hash as MockHash;\nuse Pass"
  },
  {
    "path": "test/Unit/Password/Implementation/DrupalTest.php",
    "chars": 6321,
    "preview": "<?php\n\nuse PasswordLib\\Core\\Strength\\Medium as MediumStrength;\nuse PasswordLibTest\\Mocks\\Random\\Generator as MockGenerat"
  },
  {
    "path": "test/Unit/Password/Implementation/HashTest.php",
    "chars": 4413,
    "preview": "<?php\n\nuse PasswordLib\\Core\\Strength\\Medium as MediumStrength;\nuse PasswordLibTest\\Mocks\\Random\\Generator as MockGenerat"
  },
  {
    "path": "test/Unit/Password/Implementation/JoomlaTest.php",
    "chars": 5276,
    "preview": "<?php\n\nuse PasswordLib\\Core\\Strength\\Medium as MediumStrength;\nuse PasswordLibTest\\Mocks\\Random\\Generator as MockGenerat"
  },
  {
    "path": "test/Unit/Password/Implementation/PBKDFTest.php",
    "chars": 6343,
    "preview": "<?php\n\nuse PasswordLibTest\\Mocks\\Hash\\Hash as MockHash;\nuse PasswordLibTest\\Mocks\\Hash\\Factory as MockFactory;\nuse Passw"
  },
  {
    "path": "test/Unit/Password/Implementation/PHPASSTest.php",
    "chars": 5290,
    "preview": "<?php\n\nuse PasswordLib\\Core\\Strength\\Medium as MediumStrength;\nuse PasswordLibTest\\Mocks\\Random\\Generator as MockGenerat"
  },
  {
    "path": "test/Unit/Password/Implementation/PHPBBTest.php",
    "chars": 5263,
    "preview": "<?php\n\nuse PasswordLib\\Core\\Strength\\Medium as MediumStrength;\nuse PasswordLibTest\\Mocks\\Random\\Generator as MockGenerat"
  },
  {
    "path": "test/Unit/Password/Implementation/Password_TestCase.php",
    "chars": 1332,
    "preview": "<?php\n\nclass Unit_Password_Implementation_Password_TestCase extends PHPUnit_Framework_TestCase {\n\n    protected $class ="
  },
  {
    "path": "test/Unit/Password/Implementation/SHA256Test.php",
    "chars": 6175,
    "preview": "<?php\n\nuse PasswordLib\\Core\\Strength\\Medium as MediumStrength;\nuse PasswordLibTest\\Mocks\\Hash\\Hash as MockHash;\nuse Pass"
  },
  {
    "path": "test/Unit/Password/Implementation/SHA512Test.php",
    "chars": 6542,
    "preview": "<?php\n\nuse PasswordLib\\Core\\Strength\\Medium as MediumStrength;\nuse PasswordLibTest\\Mocks\\Hash\\Hash as MockHash;\nuse Pass"
  },
  {
    "path": "test/Unit/PasswordLibTest.php",
    "chars": 2350,
    "preview": "<?php\n\nuse PasswordLib\\PasswordLib;\nuse PasswordLib\\Password\\Implementation\\Blowfish;\n\nclass Unit_PasswordLibTest extend"
  },
  {
    "path": "test/Unit/Random/FactoryTest.php",
    "chars": 3771,
    "preview": "<?php\n\nuse PasswordLibTest\\Mocks\\Random\\Mixer;\nuse PasswordLibTest\\Mocks\\Random\\Source;\n\nuse PasswordLib\\Core\\Strength;\n"
  },
  {
    "path": "test/Unit/Random/GeneratorTest.php",
    "chars": 5758,
    "preview": "<?php\n\nuse PasswordLibTest\\Mocks\\Random\\Mixer;\nuse PasswordLibTest\\Mocks\\Random\\Source;\n\nuse PasswordLib\\Random\\Generato"
  },
  {
    "path": "test/Unit/Random/Mixer/HashTest.php",
    "chars": 1843,
    "preview": "<?php\n\nuse PasswordLib\\Random\\Mixer\\Hash;\nuse PasswordLib\\Core\\Strength;\n\nclass Unit_Random_Mixer_HashTest extends PHPUn"
  },
  {
    "path": "test/Unit/Random/Source/CAPICOMTest.php",
    "chars": 991,
    "preview": "<?php\n\nuse PasswordLib\\Random\\Source\\CAPICOM;\nuse PasswordLib\\Core\\Strength;\n\n\n\nclass Unit_Random_Source_CAPICOMTest ext"
  },
  {
    "path": "test/Unit/Random/Source/MTRandTest.php",
    "chars": 1126,
    "preview": "<?php\n\nuse PasswordLib\\Random\\Source\\MTRand;\nuse PasswordLib\\Core\\Strength;\n\n\n\nclass Unit_Random_Source_MTRandTest exten"
  },
  {
    "path": "test/Unit/Random/Source/MicroTimeTest.php",
    "chars": 1029,
    "preview": "<?php\n\nuse PasswordLib\\Random\\Source\\MicroTime;\nuse PasswordLib\\Core\\Strength;\n\n\n\nclass Unit_Random_Source_MicroTimeTest"
  },
  {
    "path": "test/Unit/Random/Source/RandTest.php",
    "chars": 1113,
    "preview": "<?php\n\nuse PasswordLib\\Random\\Source\\Rand;\nuse PasswordLib\\Core\\Strength;\n\nclass Unit_Random_Source_RandTest extends PHP"
  },
  {
    "path": "test/Unit/Random/Source/URandomTest.php",
    "chars": 1178,
    "preview": "<?php\n\nuse PasswordLib\\Random\\Source\\URandom;\n\nuse PasswordLib\\Core\\Strength;\n\n\n\nclass Unit_Random_Source_URandomTest ex"
  },
  {
    "path": "test/Unit/Random/Source/UniqIDTest.php",
    "chars": 1007,
    "preview": "<?php\n\nuse PasswordLib\\Random\\Source\\UniqID;\nuse PasswordLib\\Core\\Strength;\n\n\n\nclass Unit_Random_Source_UniqIDTest exten"
  },
  {
    "path": "test/Vectors/Key/Derivation/PBKDF/PBKDF2Test.php",
    "chars": 1542,
    "preview": "<?php\n\nuse PasswordLibTest\\Mocks\\Hash\\Hash as MockHash;\nuse PasswordLib\\Key\\Derivation\\PBKDF\\PBKDF2;\n\nclass Vectors_Key_"
  },
  {
    "path": "test/Vectors/Password/Implementation/APR1Test.php",
    "chars": 1512,
    "preview": "<?php\n\nuse PasswordLib\\Password\\Implementation\\APR1;\n\nclass Vectors_Password_Implementation_APR1Test extends PHPUnit_Fra"
  },
  {
    "path": "test/Vectors/Password/Implementation/BlowfishTest.php",
    "chars": 909,
    "preview": "<?php\n\nuse PasswordLib\\Password\\Implementation\\Blowfish;\n\nclass Vectors_Password_Implementation_BlowfishTest extends PHP"
  },
  {
    "path": "test/Vectors/Password/Implementation/DrupalTest.php",
    "chars": 899,
    "preview": "<?php\n\nuse PasswordLib\\Password\\Implementation\\Drupal;\n\nclass Vectors_Password_Implementation_DrupalTest extends PHPUnit"
  },
  {
    "path": "test/Vectors/Password/Implementation/PBKDFTest.php",
    "chars": 894,
    "preview": "<?php\n\nuse PasswordLib\\Password\\Implementation\\PBKDF;\n\nclass Vectors_Password_Implementation_PBKDFTest extends PHPUnit_F"
  },
  {
    "path": "test/Vectors/Password/Implementation/PHPASSTest.php",
    "chars": 899,
    "preview": "<?php\n\nuse PasswordLib\\Password\\Implementation\\PHPASS;\n\nclass Vectors_Password_Implementation_PHPASSTest extends PHPUnit"
  },
  {
    "path": "test/Vectors/Password/Implementation/PHPBBTest.php",
    "chars": 894,
    "preview": "<?php\n\nuse PasswordLib\\Password\\Implementation\\PHPBB;\n\nclass Vectors_Password_Implementation_PHPBBTest extends PHPUnit_F"
  },
  {
    "path": "test/Vectors/Random/GeneratorTest.php",
    "chars": 5618,
    "preview": "<?php\n\nuse PasswordLibTest\\Mocks\\Random\\Mixer;\nuse PasswordLibTest\\Mocks\\Random\\Source;\n\nuse PasswordLib\\Random\\Generato"
  },
  {
    "path": "test/bootstrap.php",
    "chars": 1398,
    "preview": "<?php\n/**\n * Bootstrap the library.  This registers a simple autoloader for autoloading\n * classes\n *\n * If you are usin"
  },
  {
    "path": "test/lib/VectorParser/CAVS.php",
    "chars": 1306,
    "preview": "<?php\n\nnamespace PasswordLibTest\\lib\\VectorParser;\n\nclass CAVS {\n\n    protected $file = '';\n\n    protected $vectors = ar"
  },
  {
    "path": "test/lib/VectorParser/NESSIE.php",
    "chars": 1401,
    "preview": "<?php\n\nnamespace PasswordLibTest\\lib\\VectorParser;\n\nclass NESSIE {\n    \n    protected $file = '';\n    \n    protected $ve"
  },
  {
    "path": "test/lib/VectorParser/RFC3610.php",
    "chars": 1184,
    "preview": "<?php\n\nnamespace PasswordLibTest\\lib\\VectorParser;\n\nclass RFC3610 {\n    \n    protected $file = '';\n    \n    protected $v"
  },
  {
    "path": "test/lib/VectorParser/SSV.php",
    "chars": 622,
    "preview": "<?php\n\nnamespace PasswordLibTest\\lib\\VectorParser;\n\nclass SSV {\n    \n    protected $file = '';\n    \n    protected $vecto"
  }
]

About this extraction

This page contains the full source code of the ircmaxell/PHP-PasswordLib GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 144 files (3.1 MB), approximately 822.8k tokens, and a symbol index with 670 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!