You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PKCS#5 is a subset of PKCS#7, where PKCS#7 supports variable block sizes.
In this case the implementation is hard-coded to protected $blockSize = 8; thus using PKCS#5.
5. Separate the encoded message EM into a message M and a padding
string PS:
EM = M || PS ,
where the padding string PS consists of some number psLen
octets each with value psLen, where psLen is between 1 and 8.
If it is not possible to separate the encoded message EM in
this manner, output "decryption error" and stop.
I might not have the last part implemented, to respect only paddings in range from 1 to 8, but otherwise it is implemented as specified.
the About statment mentions PKCS#5 but the coding use PKCS#7 , to get the PKCS#5 following code of DESEncryptor.php have to be removed:
if (!$this->encrypt) {
$aPadding = array_values(unpack('C', substr($text, -1)));
$padding = $aPadding[0];
$text = substr($text, 0, strlen($text) - $padding);
}
I needed to use it with PKCS#5, perhaps you can implement a suitable parameter
The text was updated successfully, but these errors were encountered: