class Crypt implements CryptInterface (View source)

The Crypt class.

Methods

__construct(CipherInterface $cipher, string $key = null, string $iv = null)

Class init.

string
encrypt(string $string, string $key = null, string $iv = null)

encrypt

string
decrypt(string $string, string $key = null, string $iv = null)

decrypt

boolean
verify(string $string, string $hash, string $key = null, string $iv = null)

match

string
getIV()

Method to get property Public

setIV(string $iv)

Method to set property public

null|string
getKey()

Method to get property Private

setKey(null|string $key)

Method to set property private

Details

at line line 50
__construct(CipherInterface $cipher, string $key = null, string $iv = null)

Class init.

Parameters

CipherInterface $cipher
string $key
string $iv

Exceptions

InvalidArgumentException

at line line 71
string encrypt(string $string, string $key = null, string $iv = null)

encrypt

Parameters

string $string
string $key
string $iv

Return Value

string

at line line 90
string decrypt(string $string, string $key = null, string $iv = null)

decrypt

Parameters

string $string
string $key
string $iv

Return Value

string

at line line 110
boolean verify(string $string, string $hash, string $key = null, string $iv = null)

match

Parameters

string $string
string $hash
string $key
string $iv

Return Value

boolean

at line line 120
string getIV()

Method to get property Public

Return Value

string

at line line 132
Crypt setIV(string $iv)

Method to set property public

Parameters

string $iv

Return Value

Crypt Return self to support chaining.

at line line 144
null|string getKey()

Method to get property Private

Return Value

null|string

at line line 162
Crypt setKey(null|string $key)

Method to set property private

Parameters

null|string $key

Return Value

Crypt Return self to support chaining.

Exceptions

InvalidArgumentException