public class Cryptography

class.cryptography.php #17

Cryptography is a utility class that offers a number of general purpose cryptography- related functions for message digestation as well as (backwards-)compatibility checking. The message digestation algorithms are placed in the subclasses MD5, SHA1 and PBKDF2.


static boolean compare(string $input, string $hash, boolean $isHash)

Compares a given hash with a clean text password by figuring out the algorithm that has been used and then calling the appropriate sub-class

  • $input stringthe cleartext password

  • $hash stringthe hash the password should be checked against


the result of the comparison

See Also
static string generateSalt(integer $length)

Generates a salt to be used in message digestation.

  • $length integerthe length of the salt


a hexadecimal string

static string hash(string $input)

Uses an instance of PBKDF2 to create a hash. If you require other hashes, see the related functions of the MD5 or SHA1 classes

  • $input stringthe string to be hashed


the hashed string

See Also
static boolean requiresMigration(string $hash)

Checks if provided hash has been computed by most recent algorithm returns true if otherwise

  • $hash stringthe hash to be checked


whether the hash should be re-computed

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details