Use the StreamTransformationFilter, which will remove the padding for you
by default. See
http://www.eskimo.com/~weidai/cgi-bin/fom.cgi?file=79 for more details.
On Wed, Oct 20, 2004 at 01:47:15PM +0530, Vishal Rao wrote:
> Hi,
>
> Using CryptoPP API (ver 5.0.4 FIPS validated DLL) if I try to decrypt
> (block) data which (last block) is pkcs5 padded I am getting the pkcs5
> pad as well in the output. how do I get the CryptoPP API (ver 5.0.4)
> to handle/discard the padding?
>
> I saw some mention of the constant "CRYPTOPP_PAD_PKCS5" while
> searching google but where do I specify this padding mode in the
> CryptoPP API usage?
>
> Of course, FYI, pkcs5 padding is something like the remaining unused
> bytes in a block are filled with a value which is the count itself (of
> the unused bytes).
>
> Thanks,
> Vishal
>
> PS: I am doing something like
>
> byte * pIV = {1, 2, 3, 4, 5, 6, 7, 8};
>
> DES_EDE3_Decryption * p3DES = new DES_EDE3_Decryption...;
>
> BlockOrientedCipherModeBase * pCipher = new
> CBC_Mode_ExternalCipher::Decryption(*p3DES, pIV);
>
> and in a loop...
>
> pCipher->ProcessData(pData, pData, uiBlockSize);
>
> even if i use:
> pCipher->ProcessLastBlock(pData, pData, uiBlockSize);
> I still get the padding...
>
> --
> "Thou shalt not follow the null pointer for at its end madness and chaos lie."