CSharpTest.Net
ModifiedRijndael Class
Members  Example  See Also  Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Crypto Namespace : ModifiedRijndael Class

Glossary Item Box

This class is provided to essentially unlock the Rijndael algorithm from the constraints imposed by the AES standards. The Rijndael algorithm here supports a wider length of key sizes and allows users to explicitly set the number of rounds. This class is fully AES compliant when used with key sizes of 16, 24, or 32 bytes with rounds of 10, 12, and 14 respectivly.

Syntax

Visual Basic (Declaration) 
Public Class ModifiedRijndael 
   Inherits System.Security.Cryptography.SymmetricAlgorithm
C# 
public class ModifiedRijndael : System.Security.Cryptography.SymmetricAlgorithm 

Example

Library/Library.Test/TestModifiedRijndael.cs

C#Copy Code
RijndaelManaged r = new RijndaelManaged();

foreach (int blksz in AllKeySizes(r.LegalBlockSizes))
{
    r.BlockSize = blksz;
    r.GenerateIV();

    foreach (int keysz in AllKeySizes(r.LegalKeySizes))
    {
        r.KeySize = keysz;
        r.GenerateKey();

        ModifiedRijndael modified = ModifiedRijndael.Create(typeof(ModifiedRijndael).FullName);
        modified.BlockSize = r.BlockSize;
        modified.KeySize = r.KeySize;
        modified.IV = r.IV;
        modified.Key = r.Key;
        modified.Padding = r.Padding;
        modified.Mode = r.Mode;

        TestEncryptDecrypt(r, modified);
        TestEncryptDecrypt(modified, r);
    }
}
VB.NETCopy Code
Dim r As New RijndaelManaged()

For Each blksz As Integer In AllKeySizes(r.LegalBlockSizes)
    r.BlockSize = blksz
    r.GenerateIV()

    For Each keysz As Integer In AllKeySizes(r.LegalKeySizes)
        r.KeySize = keysz
        r.GenerateKey()

        Dim modified As ModifiedRijndael = ModifiedRijndael.Create(GetType(ModifiedRijndael).FullName)
        modified.BlockSize = r.BlockSize
        modified.KeySize = r.KeySize
        modified.IV = r.IV
        modified.Key = r.Key
        modified.Padding = r.Padding
        modified.Mode = r.Mode

        TestEncryptDecrypt(r, modified)
        TestEncryptDecrypt(modified, r)
    Next
Next

Inheritance Hierarchy

System.Object
   System.Security.Cryptography.SymmetricAlgorithm
      CSharpTest.Net.Crypto.ModifiedRijndael

Requirements

Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7

See Also

Reference

ModifiedRijndael Members
CSharpTest.Net.Crypto Namespace

Source Code

Library/Crypto/ModifiedRijndael.cs

Used By

ModifiedRijndael ModifiedRijndael.Create(String)

Generated with Document! X 2011 by Innovasys