Padding Modes for Symmetric Block Ciphers. How to pad the message processed by block ciphers when they don't come out to the being the size of the block.
[
Edit]
[System.Runtime.InteropServices.ComVisible(true)] public enum PaddingMode |
|
Remarks
Members
Member Name | Description |
---|
ANSIX923 | Documentation for this section has not yet been entered.
[Edit]
|
ISO10126 | Documentation for this section has not yet been entered.
[Edit]
|
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.
[Edit]
|
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).
[Edit]
|
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.
[Edit]
|
Requirements
Namespace: System.Security.Cryptography
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0