PHP Interface Phalcon\Legacy\CryptInterface

Interface for Phalcon\Legacy\Crypt
Show file Open project: phalcon/incubator

Public Methods

Method Description
decrypt ( string $text, string $key = null ) : string Decrypts a text
decryptBase64 ( string $text, mixed $key = null ) : string Decrypt a text that is coded as a base64 string
encrypt ( string $text, mixed $key = null ) : string Encrypts a text
encryptBase64 ( string $text, mixed $key = null ) : string Encrypts a text returning the result as a base64 string
getAvailableCiphers ( ) : array Returns a list of available cyphers
getAvailableModes ( ) : array Returns a list of available modes
getCipher ( ) : string Returns the current cipher
getKey ( ) : string Returns the encryption key
getMode ( ) : string Returns the current encryption mode
setCipher ( string $cipher ) : Phalcon\Legacy\CryptInterface Sets the cipher algorithm
setKey ( string $key ) : Phalcon\Legacy\CryptInterface Sets the encryption key
setMode ( string $mode ) : Phalcon\Legacy\CryptInterface Sets the encrypt/decrypt mode

Method Details

decrypt() public method

Decrypts a text
public decrypt ( string $text, string $key = null ) : string
$text string
$key string
return string

decryptBase64() public method

Decrypt a text that is coded as a base64 string
public decryptBase64 ( string $text, mixed $key = null ) : string
$text string
$key mixed
return string

encrypt() public method

Encrypts a text
public encrypt ( string $text, mixed $key = null ) : string
$text string
$key mixed
return string

encryptBase64() public method

Encrypts a text returning the result as a base64 string
public encryptBase64 ( string $text, mixed $key = null ) : string
$text string
$key mixed
return string

getAvailableCiphers() public method

Returns a list of available cyphers
public getAvailableCiphers ( ) : array
return array

getAvailableModes() public method

Returns a list of available modes
public getAvailableModes ( ) : array
return array

getCipher() public method

Returns the current cipher
public getCipher ( ) : string
return string

getKey() public method

Returns the encryption key
public getKey ( ) : string
return string

getMode() public method

Returns the current encryption mode
public getMode ( ) : string
return string

setCipher() public method

Sets the cipher algorithm
public setCipher ( string $cipher ) : Phalcon\Legacy\CryptInterface
$cipher string
return Phalcon\Legacy\CryptInterface

setKey() public method

Sets the encryption key
public setKey ( string $key ) : Phalcon\Legacy\CryptInterface
$key string
return Phalcon\Legacy\CryptInterface

setMode() public method

Sets the encrypt/decrypt mode
public setMode ( string $mode ) : Phalcon\Legacy\CryptInterface
$mode string
return Phalcon\Legacy\CryptInterface