【发布时间】:2012-06-09 15:52:06
【问题描述】:
RijndaelManaged 类属性 KeySize 、 BlockSize 、 FeedbackSize 和 Padding 的默认值是什么? 默认值是否也是最好的?
【问题讨论】:
标签: asp.net encryption rijndaelmanaged
RijndaelManaged 类属性 KeySize 、 BlockSize 、 FeedbackSize 和 Padding 的默认值是什么? 默认值是否也是最好的?
【问题讨论】:
标签: asp.net encryption rijndaelmanaged
这里是 Rijndeal 类的无参数构造函数(RijndaelManaged 继承自该类)
protected Rijndael()
{
this.KeySizeValue = 256;
this.BlockSizeValue = 128;
this.FeedbackSizeValue = this.BlockSizeValue;
this.LegalBlockSizesValue = Rijndael.s_legalBlockSizes;
this.LegalKeySizesValue = Rijndael.s_legalKeySizes;
}
什么是最佳值,很难说,这取决于您的使用情况。这就是它们被定义为属性的方式:)
【讨论】:
如果您查看 Rijndael 继承自的“System.Security.Cryptography”类,您将在 cmets 中看到。
// Summary:
// Gets or sets the padding mode used in the symmetric algorithm.
//
// Returns:
// The padding mode used in the symmetric algorithm. The default is System.Security.Cryptography.PaddingMode.PKCS7.
//
// Exceptions:
// T:System.Security.Cryptography.CryptographicException:
// The padding mode is not one of the System.Security.Cryptography.PaddingMode values.
public virtual PaddingMode Padding { get; set; }
【讨论】: