Subject: | Patch to add support for NULL (\0) padding |
Hi,
An issue with the mcrypt support in PHP made me add NULL (\0) padding
support in the module. Attached you will find a patch / diff for it.
regards
Subject: | ECB.diff |
17c17
< @EXPORT = qw(PADDING_NONE PADDING_AUTO PADDING_NULL);
---
> @EXPORT = qw(PADDING_NONE PADDING_AUTO);
23d22
< use constant PADDING_NULL => 2;
349,352d347
< elsif ($padstyle == PADDING_NULL)
< {
< $result =~ s/\0*$//s;
< }
390,393d384
< elsif ($padstyle == PADDING_NULL)
< {
< $data .= pack("C*", (0) x ($bs-(length($data) % $bs)));
< }
589,593c580
< when decrypting) the same way Crypt::CBC does, namely using the
< PKCS#5 / PKCS#7 method (RFC 5652). When set to PADDING_NULL the ECB
< module padds (and truncates when decrypting) with zero (null) characters.
< PADDING_NULL should not be used when encrypting binaries.
< More info on padding here: http://www.di-mgt.com.au/cryptopad.html
---
> when decrypting) the same way Crypt::CBC does.
693c680
< The three constants naming the padding styles are exported by default:
---
> The two constants naming the padding styles are exported by default:
697d683
< PADDING_NULL => 2