AbstractAES

Abstract AES encryption class

abstract
since

4.0.0

Methods

getZeroPadding

Returns null bytes to append to the string so that it's zero padded to the specified block size

getZeroPadding(string $string, integer $blockSize) : string

Arguments

$string

stringThe binary string which will be zero padded

$blockSize

integerThe block size

Response

stringThe zero bytes to append to the string to zero pad it to $blockSize

resizeKey

Trims or zero-pads a key / IV

resizeKey(string $key, integer $size) : null|string

Arguments

$key

stringThe key or IV to treat

$size

integerThe block size of the currently used algorithm

Response

null|stringNull if $key is null, treated string of $size byte length otherwise