Overview

Packages

  • Auth
  • Config
  • Controller
  • Date
  • Db
  • Feed
    • Abstract
    • Writers
  • File
    • Decorator
  • Form
    • Element
  • Image
  • Log
    • Writer
  • Net
    • Exception
  • None
  • PHP
  • PHPMailer
  • Session
  • Util
  • Validate
    • Validator
  • Zend
    • Registry

Classes

  • Auth_ACL
  • Auth_Auth
  • Auth_Bcrypt
  • Auth_Util
  • Auth_WithRole
  • Overview
  • Package
  • Class
  • Tree

Class Auth_Bcrypt

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

$bcrypt = new Auth_Bcrypt(11);
$hash = $bcrypt->hash('mypass');
var_dump($bcrypt->check('mypass',$hash);
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
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
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
Chaine en claire
$hashedStr
string
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 Framework API documentation generated by ApiGen 2.6.1