As I understand it, PKCS5 and PKCS7 padding are essentially the same -- basically the padding bytes are all filled with the number of bytes being padded. The only potential difference between the two is how to pad if the amount of padding is greater than 255 bytes, which isn't an issue since the TripleDESCryptoServiceProvider block size is 8 bytes. So you should be safe using PaddingMode.PKCS7.
As for the IV, that is odd. CBC isn't really considered secure unless you use an IV. If no IV is used by the server I suppose that's the same as providing an IV as byte array of zeros since the values are XOR'd. You could try that and see if it works. But not using an IV with CBC is suprising to me.
Brian Stern [MSFT]
|