SymmetricAlgorithm.Padding 属性
定义
获取或设置对称算法中使用的填充模式。Gets or sets the padding mode used in the symmetric algorithm.
public:
virtual property System::Security::Cryptography::PaddingMode Padding { System::Security::Cryptography::PaddingMode get(); void set(System::Security::Cryptography::PaddingMode value); };
public virtual System.Security.Cryptography.PaddingMode Padding { get; set; }
member this.Padding : System.Security.Cryptography.PaddingMode with get, set
Public Overridable Property Padding As PaddingMode
属性值
对称算法中使用的填充模式。The padding mode used in the symmetric algorithm. 默认值为 PKCS7。The default is PKCS7.
例外
该填充模式不是 PaddingMode 值之一。The padding mode is not one of the PaddingMode values.
注解
大多数纯文本消息不包含完全填充块的多个字节。Most plain text messages do not consist of a number of bytes that completely fill blocks. 通常,没有足够的字节来填充最后一个块。Often, there are not enough bytes to fill the last block. 发生这种情况时,会将填充字符串添加到文本中。When this happens, a padding string is added to the text. 例如,如果块长度为64位,而最后一个块只包含40位,则会添加24位填充。For example, if the block length is 64 bits and the last block contains only 40 bits, 24 bits of padding are added. PaddingMode有关特定模式的说明,请参阅枚举。See the PaddingMode enumeration for a description of specific modes.