2012-06-05 104 views

回答

3

這裏是Rijndeal類的參數構造函數(RijndaelManaged的繼承形成類)

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

什麼是最好的價值,這是很難說,這取決於您的使用。這就是他們被定義爲屬性的方式:)

+0

謝謝,paddingMode呢?建議設置什麼? –

+3

默認爲this.PaddingValue = PaddingMode.PKCS7;有關更多信息,請參閱http://crypto.stackexchange.com/questions/1486/how-to-choose-a-padding-mode-with-aes –

+0

CBC是默認鏈接模式嗎? – vojta

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; } 
相關問題