implements Phalcon\CryptInterface
Provides encryption facilities to phalcon applications
$crypt = new \Phalcon\Crypt(); $key = "le password"; $text = "This is a secret text"; $encrypted = $crypt->encrypt($text, $key); echo $crypt->decrypt($encrypted, $key);
Changes the padding scheme used
Sets the cipher algorithm
Returns the current cipher
Sets the encryption key
Returns the encryption key
Pads texts before encryption
If the function detects that the text was not padded, it will return it unmodified
Encrypts a text
$encrypted = $crypt->encrypt("Ultra-secret text", "encrypt password");
Decrypts an encrypted text
echo $crypt->decrypt($encrypted, "decrypt password");
Encrypts a text returning the result as a base64 string
Decrypt a text that is coded as a base64 string
Returns a list of available ciphers
© 2011–2017 Phalcon Framework Team
Licensed under the Creative Commons Attribution License 3.0.
https://docs.phalconphp.com/en/latest/api/Phalcon_Crypt.html