\Pydio\Core\Utils\CryptoZeroPaddingRijndael

Class ZeroPaddingRijndael

Summary

Methods
Properties
Constants
_pad()
_unpad()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

_pad()

_pad(string  $text) : string

Pads a string

Pads a string using the RSA PKCS padding standards so that its length is a multiple of the blocksize. $this->block_size - (strlen($text) % $this->block_size) bytes are added, each of which is equal to chr($this->block_size - (strlen($text) % $this->block_size)

If padding is disabled and $text is not a multiple of the blocksize, the string will be padded regardless and padding will, hence forth, be enabled.

Parameters

string $text

Throws

\LengthException

if padding is disabled and the plaintext's length is not a multiple of the block size

Returns

string

_unpad()

_unpad(string  $text) : string

Unpads a string.

If padding is enabled and the reported padding length is invalid the encryption key will be assumed to be wrong and false will be returned.

Parameters

string $text

Throws

\LengthException

if the ciphertext's length is not a multiple of the block size

Returns

string