Overview

Namespaces

  • None
  • PHP
  • Pry
    • Auth
      • Interfaces
    • Config
    • Controller
    • Date
    • Db
    • Feed
      • Abstracts
      • Writers
    • File
      • Decorator
    • Form
      • Element
    • Image
    • Log
      • Writer
    • Net
      • Exception
    • Session
    • Util
    • Validate
      • Validator
    • View

Classes

  • ACL
  • Auth
  • Bcrypt
  • Util
  • WithRole
  • Overview
  • Namespace
  • Class
  • Tree

Class Bcrypt

Classe implémentant l'algorithm bcrypt pour le cryptage de mot de passe.

$bcrypt = new Bcrypt(11);
$hash = $bcrypt->hash('mypass');
var_dump($bcrypt->check('mypass',$hash);
Namespace: Pry\Auth
Package: Auth
Author: Olivier ROGER <oroger.fr>
Version: 1.0
See: http://en.wikipedia.org/wiki/Bcrypt
See: http://stackoverflow.com/questions/4795385/how-do-you-use-bcrypt-for-hashing-passwords-in-php
Located at Auth/Bcrypt.class.php
Methods summary
public
# __construct( integer $rounds = 12 )

Initialise le cryptage

Initialise le cryptage

Parameters

$rounds
integer
$rounds Nombre d'itération pour l'algo de hashage entre 4 et 31. Plus ce paramètre est élevé plus le temps de hashage sera long. 12 par défaut

Throws

RuntimeException
Si le cryptage BlowFish n'est pas supporté sur l'installation
InvalidArgumentException
Le paramètres n'est pas compris entre 4 et 31.
public string
# hash( string $str )

Hash la chaine donnée

Hash la chaine donnée

Parameters

$str
string
$str Chaine en clair

Returns

string
Un hash de la chaine de 60 caractères

Throws

type
public static boolean
# check( string $str, string $hashedStr )

Vérifie une chaine avec un hash

Vérifie une chaine avec un hash

Parameters

$str
string
$str Chaine en claire
$hashedStr
string
$hashedStr Un hash

Returns

boolean
True si les deux correspondent , false sinon
Constants summary
string SALTBASE '$2a$'
#

Base du grain de sel blowfish

Base du grain de sel blowfish

Pry API documentation generated by ApiGen 2.8.0