Crypt::getKey

public getKey () Returns the encryption key

Crypt::getCipher

public getCipher () Returns the current cipher

Crypt::getAvailableCiphers

public getAvailableCiphers () Returns a list of available ciphers

Crypt::encryptBase64

public encryptBase64 (mixed $text, [mixed $key], [mixed $safe]) Encrypts a text returning the result as a base64 string

Crypt::encrypt

public encrypt (mixed $text, [mixed $key]) Encrypts a text $encrypted = $crypt->encrypt("Ultra-secret text", "encrypt password");

Crypt::decryptBase64

public decryptBase64 (mixed $text, [mixed $key], [mixed $safe]) Decrypt a text that is coded as a base64 string

Crypt::decrypt

public decrypt (mixed $text, [mixed $key]) Decrypts an encrypted text echo $crypt->decrypt($encrypted, "decrypt password");

Crypt

implements Phalcon\CryptInterface Source on GitHub 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); Constants integer PADDING_DEFAULT integer PADDING_ANSI_X_923 integer PADDING_PKCS7 integer PADDING_ISO_10126 integer PADDING_ISO_IEC_7816_4 integer PADDING_ZERO integer PADDING_SPACE Methods public se

Cookies Management

Cookies are a very useful way to store small pieces of data on the client’s machine that can be retrieved even if the user closes his/her browser. Phalcon\Http\Response\Cookies acts as a global bag for cookies. Cookies are stored in this bag during the request execution and are sent automatically at the end of the request. Basic Usage You can set/get cookies by just accessing the ‘cookies’ service in any part of the application where services can be accessed: use Phalcon\Mvc\Controller; class

Contextual Escaping

Websites and web applications are vulnerable to XSS attacks and although PHP provides escaping functionality, in some contexts it is not sufficient/appropriate. Phalcon\Escaper provides contextual escaping and is written in Zephir, providing the minimal overhead when escaping different kinds of texts. We designed this component based on the XSS (Cross Site Scripting) Prevention Cheat Sheet created by the OWASP. Additionally, this component relies on mbstring to support almost any charset. To il