Pads a string using the scheme defined in PKCS#7.
More...
Pads a string using the scheme defined in PKCS#7.
Definition at line 8 of file Pkcs7.php.
fpoirotte\Cryptal\Padding\Pkcs7::getPaddingData |
( |
|
$blockSize, |
|
|
|
$expectedSize |
|
) |
| |
Return padding data to form a complete block.
- Parameters
-
int | $blockSize | The cipher's block size, in bytes. |
int | $expectedSize | The padding's expected size (in bytes) to form a (possibly new) complete block. This value is always such that: |
- Return values
-
Implements fpoirotte\Cryptal\PaddingInterface.
Definition at line 10 of file Pkcs7.php.
fpoirotte\Cryptal\Padding\Pkcs7::getPaddingSize |
( |
|
$paddedData, |
|
|
|
$blockSize |
|
) |
| |
Return the size (in bytes) of the padding in some already-padded data.
- Parameters
-
string | $paddedData | The padded data to analyze. |
int | $blockSize | The cipher's block size, in bytes. |
- Exceptions
-
Exception | An exception is thrown when the supplied data is invalid (was not padded using the currently-selected scheme). |
- Warning
- Some padding schemes can generate ambiguous data, resulting in possible data loss while removing the padding. This method suffers from the same shortcomings. If possible, you should not rely on this method to determine the plaintext's length. Instead, you should retrieve it using other means (eg. out-of-band communications).
Implements fpoirotte\Cryptal\PaddingInterface.
Definition at line 15 of file Pkcs7.php.
The documentation for this class was generated from the following file: