Block ciphers requires complete block to encrypt. Any block smaller than the cipher block size must be padded.
Cipher padding modes are only applicable to block ciphers. Stream ciphers, like RC4(tm), do not use them.
Member Name Description ANSIX923 Documentation for this section has not yet been entered. ISO10126 Documentation for this section has not yet been entered. None No padding is added. This may be the case when an application use a custom padding or when data packets are always a multiple of the cipher block size. A System.Security.Cryptography.CryptographicException is thrown if the last block size is different from the cipher block size. PKCS7 Default padding. This padding adds the byte "padding length" as the padding material. That is a padding of 4 bytes will be 0x04 0x04 0x04 0x04. In case the last block size is equal to the cipher block size a new block is added containing only the padding (e.g. 8 times 0x08). Despite it's name the padding is detailled in PKCS #5 (tp://www.rsasecurity.com/rsalabs/pkcs/pkcs-5/index.html). Zeros The last block is padded with 0x00. This makes it difficult when decrypting to know if the last bytes are real 0x00 or padding material. In the .NET framework the application decrypting the block must unpad the zero itself.
Namespace: System.Security.Cryptography
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0