Giter Site home page Giter Site logo

phpass's Introduction

Password Hash Library

Build Status

Script base on OpenWall's PhPass, based on the 0.3 release, change to ready for:

  • Name Space
  • Composer (Autoload)
  • PHP 5
  • Unit Tested

There was make some changes and add 2 methods & Name Space , to make the password hash could use install on composer and Name Space Support.

We are not claim of the projects, but we just add some comments and make more compatible with new version of PHP for our projects.

Change & Additional

VERSION 1.1.0

- Add 1 static method `isMaybeHash` for checking is hashed string
- Add `VERSION` constant

VERSION 1.0

- Dump version to 1.0.0
- Add Comments
- Adding visibility on methods & property
- Add 2 methods alternative `verify` & `hash`
- Remove /dev/urandom , that maybe thrown of error as random state ( default uses loop )

Installation

Add requirement to the composer.json file and run composer install:

    {
        "require": {
            "pentagonal/phpass": "1.1"
        }
    }

Usage

<?php
/**
 * Require Autoload From Vendor
 */
require_once(__DIR__ . "/vendor/autoload.php");

/**
 * Initiate of PasswordHash
 * @type Object instance of \Pentagonal\PhPass\PasswordHash
 */
$passwordHash = new \Pentagonal\PhPass\PasswordHash();

/**
 * Hash the string of password
 * @uses \Pentagonal\PhPass\PasswordHash::hashPassword([string] password) | or use hash([string] password) as another method aliases
 * @type string
 */
$hashedPassword = $passwordHash->hashPassword('The String Plain Text Password');

/**
 * Check password match
 * @uses \Pentagonal\PhPass\PasswordHash::checkPassword([string] password, [string] hashedPassword) | or use check([string] password, [string] hashedPassword) as another method aliases
 * @type string
 */
$isPasswordMatch = $passwordHash->checkPassword('The String Plain Text Password', $hashedPassword);

/**
 * Check if string maybe hashed 
 */
$isHashed = Pentagonal\PhPass\PasswordHash::isMaybeHash($hashedPassword);

phpass's People

Contributors

pentagonal avatar

Stargazers

Zahroul Ulum avatar ArrayObject avatar Block Tech Indonesia avatar Giresa rahardia avatar Lukman Gilang Tara avatar  avatar icosoar avatar Gilang Andrea avatar SMK Pasirian avatar  avatar NAWA avatar

Watchers

James Cloos avatar Zahroul Ulum avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.