【问题标题】:what are default values for asp.net RijndaelManaged class propertiesasp.net RijndaelManaged 类属性的默认值是什么
【发布时间】:2012-06-09 15:52:06
【问题描述】:

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

【问题讨论】:

    标签: asp.net encryption rijndaelmanaged


    【解决方案1】:

    这里是 Rijndeal 类的无参数构造函数(RijndaelManaged 继承自该类)

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

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

    【讨论】:

    【解决方案2】:

    如果您查看 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; }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-12-06
      • 2019-10-20
      • 1970-01-01
      • 2011-12-11
      • 2011-02-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多