4

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

4

2 回答 2

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

什么是最佳值,很难说,这取决于您的使用情况。这就是它们被定义为属性的方式:)

于 2012-06-05T15:56:18.910 回答
0

如果您查看 Rijndael 继承自的“System.Security.Cryptography”类,您将在评论中看到。

// 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; }
于 2018-01-04T11:38:24.000 回答