PHP Class ManaPHP\Security\Crypt

Inheritance: extends ManaPHP\Component, implements ManaPHP\Security\CryptInterface
Afficher le fichier Open project: manaphp/manaphp

Protected Properties

Свойство Type Description
$_key string
$_mcrypt resource

Méthodes publiques

Méthode 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 méthode

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

decrypt() public méthode

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

encrypt() public méthode

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

Property Details

$_key protected_oe property

protected string $_key
Résultat string

$_mcrypt protected_oe property

protected resource $_mcrypt
Résultat resource