__construct() __construct( $key, $cipher = \app\framework\Component\Encryption\Ciphers::AES_128_CBC) Parameters $key $cipher
supported() supported(string $key, string $cipher) : boolean Determine if the given key and cipher combination is valid. Parameters string $key string $cipher Returns boolean
generateKey() generateKey(string $cipher) : string Create a new encryption key for the given cipher. Parameters string $cipher Throws \Exception Returns string
encrypt() encrypt( $value, boolean $serialize = true) : string Encrypt the given value Parameters $value boolean $serialize Throws \Exception Returns string
decrypt() decrypt( $payload, boolean $unserialize = true) : mixed Parameters $payload boolean $unserialize Throws \Exception Returns mixed
hash() hash(string $iv, mixed $value) : string Create a MAC for the given value. Parameters string $iv mixed $value Returns string
getJsonPayload() getJsonPayload(string $payload) : array Get the JSON array from the given payload. Parameters string $payload Throws \app\framework\Component\Encryption\DecryptException Returns array
validPayload() validPayload(mixed $payload) : boolean Verify that the encryption payload is valid. Parameters mixed $payload Returns boolean
validMac() validMac(array $payload) : boolean Determine if the MAC for the given payload is valid. Parameters array $payload Throws \Exception Returns boolean
calculateMac() calculateMac(array $payload, string $bytes) : string Calculate the hash of the given payload. Parameters array $payload string $bytes Returns string