2017 © Pedro Peláez
 

library phalconscrypt

Class to add scrypt hashing to the Phalcon framework. Requires scrypt extension.

image

moderndeveloperllc/phalconscrypt

Class to add scrypt hashing to the Phalcon framework. Requires scrypt extension.

  • Friday, October 3, 2014
  • by ModernDeveloperLLC
  • Repository
  • 0 Watchers
  • 0 Stars
  • 3 Installations
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

PhalconScrypt

This class is an extension to the built-in Phalcon\Security class that add functions to generate scrypt hashes that are compatible with the wg/scrypt Java implementation., (*1)


Installing via Composer

Install composer in a common location or in your project:, (*2)

curl -s http://getcomposer.org/installer | php

Create the composer.json file as follows:, (*3)

{
    "require": {
        "moderndeveloperllc/phalconscrypt" : "1.0.*"
    }
}

Run the composer installer:, (*4)

php composer.phar install

Service Configuration

You will need to overwrite the existing Security service with the new class. You will have access to all the Phalcon\Security functions as the PhalconScrypt class extends that class., (*5)

<?php
use ModDev\PhalconScrypt\PhalconScrypt;

$di->set(
    'security',
    function () {
        return new PhalconScrypt();
    },
    true
);

Loader Configuration

Library Installed Manually, (*6)

<?php
//Make sure to register namespace
$loader->registerNamespaces(array(
    //Other namespaces
  'ModDev\PhalconScrypt' => $path->to->library . '/src/ModDev/PhalconScrypt'
));

If you install the library manually, be sure to load the library in your autoloader. The easiest to do is in a registerNamespaces() function. There is only one class at the moment, but that could change in the future., (*7)

Library Installed via Composer, (*8)

<?php
// Your existing loader config...
// ...

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

Usage

Hash a password

<?php

$hashedPassword = $this->security->scryptHash('myReallyGreatPassword');

Check the hashed password against an user input

<?php

$passwordWorksBoolean = $this->security->scryptCheckHash($cleartextPassword, $hashedPassword);

Return the hash algorithm

<?php

$passwordhashType = $this->security->getHashType($hashedPassword);

The Versions

03/10 2014

dev-master

9999999-dev https://bitbucket.org/moderndeveloperllc/phalconscrypt

Class to add scrypt hashing to the Phalcon framework. Requires scrypt extension.

  Sources   Download

BSD-3

The Requires

  • php >=5.3.6
  • ext-phalcon >=1.2.4
  • ext-scrypt >=1.2

 

by Mark Garrett

framework security scrypt phalcon hashing

03/10 2014

1.0.1

1.0.1.0 https://bitbucket.org/moderndeveloperllc/phalconscrypt

Class to add scrypt hashing to the Phalcon framework. Requires scrypt extension.

  Sources   Download

BSD-3

The Requires

  • php >=5.3.6
  • ext-phalcon >=1.2.4
  • ext-scrypt >=1.2

 

by Mark Garrett

framework security scrypt phalcon hashing

03/01 2014

1.0

1.0.0.0 https://bitbucket.org/moderndeveloperllc

Class to add scrypt hashing to the Phalcon framework. Requires scrypt extension.

  Sources   Download

BSD-3

The Requires

  • php >=5.3.6
  • ext-phalcon >=1.2.4
  • ext-scrypt >=1.2

 

by Mark Garrett

framework security scrypt phalcon hashing