PHP Class ManaPHP\Security\Crypt

Inheritance: extends ManaPHP\Component, implements ManaPHP\Security\CryptInterface
Mostra file Open project: manaphp/manaphp

Protected Properties

Property Type Description
$_key string
$_mcrypt resource

Public Methods

Method Description
__construct ( string | array $options = [] ) Crypt constructor.
decrypt ( string $text, string $key = null ) : string Decrypts an encrypted text
encrypt ( string $text, string $key = null ) : string Encrypts a text

Method Details

__construct() public method

Crypt constructor.
public __construct ( string | array $options = [] )
$options string | array

decrypt() public method

echo $crypt->decrypt($encrypted, "decrypt password");
public decrypt ( string $text, string $key = null ) : string
$text string
$key string
return string

encrypt() public method

$encrypted = $crypt->encrypt("Ultra-secret text", "encrypt password");
public encrypt ( string $text, string $key = null ) : string
$text string
$key string
return string

Property Details

$_key protected_oe property

protected string $_key
return string

$_mcrypt protected_oe property

protected resource $_mcrypt
return resource