Documentation

PasswordHasher
in package

Table of Contents

Constants

MAX_PASSWORD_LENGTH  = 255

Methods

hashPassword()  : string
Create a password hash from a given string by a specific algorithm.
defaultHashPassword()  : string
Create a password hash from a given string.
getAlgorithm()  : string
Get algorithm name for PHP.

Constants

Methods

hashPassword()

Create a password hash from a given string by a specific algorithm.

public static hashPassword(string $password[, string $algorithm = '' ][, string $salt = '' ][, int $spinCount = 10000 ]) : string

2.4.2.4 ISO Write Protection Method

Parameters
$password : string

Password to hash

$algorithm : string = ''

Hash algorithm used to compute the password hash value

$salt : string = ''

Pseudorandom string

$spinCount : int = 10000

Number of times to iterate on a hash of a password

Tags
see
https://docs.microsoft.com/en-us/openspecs/office_file_formats/ms-offcrypto/1357ea58-646e-4483-92ef-95d718079d6f
Return values
string

Hashed password

defaultHashPassword()

Create a password hash from a given string.

private static defaultHashPassword(string $password) : string

This method is based on the spec at: https://interoperability.blob.core.windows.net/files/MS-OFFCRYPTO/[MS-OFFCRYPTO].pdf 2.3.7.1 Binary Document Password Verifier Derivation Method 1

It replaces a method based on the algorithm provided by Daniel Rentz of OpenOffice and the PEAR package Spreadsheet_Excel_Writer by Xavier Noguer xnoguer@rezebra.com.

Parameters
$password : string

Password to hash

Return values
string

getAlgorithm()

Get algorithm name for PHP.

private static getAlgorithm(string $algorithmName) : string
Parameters
$algorithmName : string
Return values
string

        
On this page

Search results