This package is abandoned and no longer maintained. No replacement package was suggested.

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

1.0.1 2014-10-02 23:50 UTC

This package is auto-updated.

Last update: 2019-05-15 22:01:05 UTC


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.

Installing via Composer

Install composer in a common location or in your project:

curl -s | php

Create the composer.json file as follows:

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

Run the composer installer:

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.

use ModDev\PhalconScrypt\PhalconScrypt;

    function () {
        return new PhalconScrypt();

Loader Configuration

Library Installed Manually

//Make sure to register namespace
    //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.

Library Installed via Composer

// Your existing loader config...
// ...

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


Hash a password


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

Check the hashed password against an user input


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

Return the hash algorithm


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