asp.net RijndaelManaged类属性的默认值是什么

时间:2012-06-05 15:48:25

标签: asp.net encryption rijndaelmanaged

RijndaelManaged类属性KeySize,BlockSize,FeedbackSize和Padding的默认值是什么? 并且默认值是否最好?

2 个答案:

答案 0 :(得分:4)

这是Rijndeal类的无参数构造函数(RijndaelManaged继承了该类的形式)

protected Rijndael()
{
    this.KeySizeValue = 256;
    this.BlockSizeValue = 128;
    this.FeedbackSizeValue = this.BlockSizeValue;
    this.LegalBlockSizesValue = Rijndael.s_legalBlockSizes;
    this.LegalKeySizesValue = Rijndael.s_legalKeySizes;
}

最好的价值是什么,很难说,这取决于你的用法。他们被定义为属性的方式:)

答案 1 :(得分:0)

如果你看一下" System.Security.Cryptography" Rijndael继承的类,这是你将在评论中看到的。

// 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; }