SproutCMS

This is the code documentation for the SproutCMS project

Page options:

Inherited members

class Security

Functions for implementing security, including secure random numbers

Functions

NameVisibilityDescription
compareStringspublic (static)Constant-time string comparison
getServerKeyprotected (static)Return the server key
passwordComplexitypublic (static)Check the given password meets complexity requirements
randBytepublic (static)Return a single random byte
randBytespublic (static)Returns a binary string of random bytes
randStrpublic (static)Returns a string of random characters
serverKeySignpublic (static)Generate a signature from a given set of fields, using the server key
serverKeyVerifypublic (static)Verify a signature which was generated by Security::serverKeySign

public compareStrings

bool Security::compareStrings ( string $known_string , string $user_string );

Constant-time string comparison

protected getServerKey

string Security::getServerKey ( );

Return the server key

public passwordComplexity

array Security::passwordComplexity ( string $str , int $length , int $classes , bool $bad_list );

Check the given password meets complexity requirements

public randByte

string Security::randByte ( );

Return a single random byte

public randBytes

string Security::randBytes ( int $length );

Returns a binary string of random bytes

public randStr

string Security::randStr ( [ int $length [, mixed $chars ]] );

Returns a string of random characters

public serverKeySign

string Security::serverKeySign ( array $fields );

Generate a signature from a given set of fields, using the server key

For a given set of fields, the signature will always be the same value.
Returned signatures are always URL and HTML safe

public serverKeyVerify

void Security::serverKeyVerify ( array $fields , string $signature );

Verify a signature which was generated by Security::serverKeySign