2017 © Pedro Peláez
 

library bcrypt

Customized Bcrypt for PHP

image

polarising/bcrypt

Customized Bcrypt for PHP

  • Saturday, February 18, 2017
  • by polarising
  • Repository
  • 1 Watchers
  • 3 Stars
  • 144 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 4 Versions
  • 23 % Grown

The README.md

# bcrypt

Build Status Latest Stable Version Latest Unstable Version Total Downloads License Scrutinizer Code Quality, (*1)

Instead of using PHP hash password API, encrypt plain text by using Bcrypt algorithm, and make sure it's compatible with Bcrypt in other programming languages, like Java, python., (*2)

Installing Bcrypt

The recommended way to install Bcrypt is through Composer., (*3)

# Install Composer
curl -sS https://getcomposer.org/installer | php

Next, run the Composer command to install the latest stable version of Bcrypt:, (*4)

php composer.phar require polarising/bcrypt

After installing, you need to require Composer's autoloader:, (*5)

require 'vendor/autoload.php';

You can then later update Bcrypt using composer:, (*6)

bash composer.phar update, (*7)

Quick Examples

Encrypt Plaintext, Verify Plaintext and Ciphertext

<?php
// Require the Composer autoloader.
require 'vendor/autoload.php';

use Bcrypt\Bcrypt;

// Instantiate an Bcrypt instance.
$bcrypt = new Bcrypt();

//Encrypt the plaintext
$plaintext = 'password';

//Set the Bcrypt Version, default is '2y'
$bcrypt_version = '2a';

$ciphertext = $bcrypt->encrypt($plaintext,$bcrypt_version);
print_r("\n Plaintext:".$plaintext);
print_r("\n Ciphertext:".$ciphertext);

//Verify the plaintext and ciphertext
if($bcrypt->verify($plaintext, $ciphertext)){
    print_r("\n Password verified!");
}else{
    print_r("\n Password not match!");
}

The Versions

18/02 2017

dev-master

9999999-dev

Customized Bcrypt for PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.7

 

The Development Requires

by Yang Deng

bcrypt

22/11 2016

1.0.2

1.0.2.0

Customized Bcrypt for PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.7

 

The Development Requires

by Yang Deng

bcrypt

08/11 2016

1.0.1

1.0.1.0

Customized Bcrypt for PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.7

 

The Development Requires

by Yang Deng

bcrypt

02/11 2016

1.0.0

1.0.0.0

Customized Bcrypt for PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.7

 

The Development Requires

by Yang Deng

bcrypt