Question

what are default values for RijndaelManaged class properties KeySize , BlockSize , FeedbackSize and Padding ? and are default values the best too or not ?

Was it helpful?

Solution

Here is the parameterless constructor of Rijndeal class (RijndaelManaged inherits form that class)

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

What are the best values, that is hard to say, it depends from your usage. That's way they are defined as properties :)

OTHER TIPS

If you take a look at the "System.Security.Cryptography" class which Rijndael inherits from, this is what you will see in the comments.

// 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; }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top