Rijndael クラス
アセンブリ: mscorlib (mscorlib.dll 内)



Rijndael クラスを使用してデータを暗号化し、復号化する方法を次のコード例に示します。
Imports System.Security.Cryptography Imports System.Text Imports System.IO Module RijndaelSample Sub Main() Try ' Create a new Rijndael object to generate a key ' and initialization vector (IV). Dim RijndaelAlg As Rijndael = Rijndael.Create ' Create a string to encrypt. Dim sData As String = "Here is some data to encrypt." Dim FileName As String = "CText.txt" ' Encrypt text to a file using the file name, key, and IV. EncryptTextToFile(sData, FileName, RijndaelAlg.Key, RijndaelAlg.IV) ' Decrypt the text from a file using the file name, key, and IV. Dim Final As String = DecryptTextFromFile(FileName, RijndaelAlg.Key, RijndaelAlg.IV) ' Display the decrypted string to the console. Console.WriteLine(Final) Catch e As Exception Console.WriteLine(e.Message) End Try Console.ReadLine() End Sub Sub EncryptTextToFile(ByVal Data As String, ByVal FileName As String, ByVal Key() As Byte, ByVal IV() As Byte) Try ' Create or open the specified file. Dim fStream As FileStream = File.Open(FileName, FileMode.OpenOrCreate) ' Create a new Rijndael object. Dim RijndaelAlg As Rijndael = Rijndael.Create ' Create a CryptoStream using the FileStream ' and the passed key and initialization vector (IV). Dim cStream As New CryptoStream(fStream, _ RijndaelAlg.CreateEncryptor(Key, IV), _ CryptoStreamMode.Write) ' Create a StreamWriter using the CryptoStream. Dim sWriter As New StreamWriter(cStream) Try ' Write the data to the stream ' to encrypt it. sWriter.WriteLine(Data) Catch e As Exception Console.WriteLine("An error occurred: {0}", e.Message) Finally ' Close the streams and ' close the file. sWriter.Close() cStream.Close() fStream.Close() End Try Catch e As CryptographicException Console.WriteLine("A Cryptographic error occurred: {0}", e.Message) Catch e As UnauthorizedAccessException Console.WriteLine("A file error occurred: {0}", e.Message) End Try End Sub Function DecryptTextFromFile(ByVal FileName As String, ByVal Key() As Byte, ByVal IV() As Byte) As String Try ' Create or open the specified file. Dim fStream As FileStream = File.Open(FileName, FileMode.OpenOrCreate) ' Create a new Rijndael object. Dim RijndaelAlg As Rijndael = Rijndael.Create ' Create a CryptoStream using the FileStream ' and the passed key and initialization vector (IV). Dim cStream As New CryptoStream(fStream, _ RijndaelAlg.CreateDecryptor(Key, IV), _ CryptoStreamMode.Read) ' Create a StreamReader using the CryptoStream. Dim sReader As New StreamReader(cStream) ' Read the data from the stream ' to decrypt it. Dim val As String = Nothing Try val = sReader.ReadLine() Catch e As Exception Console.WriteLine("An Cerror occurred: {0}", e.Message) Finally ' Close the streams and ' close the file. sReader.Close() cStream.Close() fStream.Close() End Try ' Return the string. Return val Catch e As CryptographicException Console.WriteLine("A Cryptographic error occurred: {0}", e.Message) Return Nothing Catch e As UnauthorizedAccessException Console.WriteLine("A file error occurred: {0}", e.Message) Return Nothing End Try End Function End Module
using System; using System.Security.Cryptography; using System.Text; using System.IO; class RijndaelSample { static void Main() { try { // Create a new Rijndael object to generate a key // and initialization vector (IV). Rijndael RijndaelAlg = Rijndael.Create(); // Create a string to encrypt. string sData = "Here is some data to encrypt."; string FileName = "CText.txt"; // Encrypt text to a file using the file name, key, and IV. EncryptTextToFile(sData, FileName, RijndaelAlg.Key, RijndaelAlg.IV); // Decrypt the text from a file using the file name, key, and IV. string Final = DecryptTextFromFile(FileName, RijndaelAlg.Key, RijndaelAlg.IV); // Display the decrypted string to the console. Console.WriteLine(Final); } catch (Exception e) { Console.WriteLine(e.Message); } Console.ReadLine(); } public static void EncryptTextToFile(String Data, String FileName, byte[] Key, byte[] IV) { try { // Create or open the specified file. FileStream fStream = File.Open(FileName, FileMode.OpenOrCreate); // Create a new Rijndael object. Rijndael RijndaelAlg = Rijndael.Create(); // Create a CryptoStream using the FileStream // and the passed key and initialization vector (IV). CryptoStream cStream = new CryptoStream(fStream, RijndaelAlg.CreateEncryptor(Key, IV), CryptoStreamMode.Write); // Create a StreamWriter using the CryptoStream. StreamWriter sWriter = new StreamWriter(cStream); try { // Write the data to the stream // to encrypt it. sWriter.WriteLine(Data); } catch (Exception e) { Console.WriteLine("An error occurred: {0}", e.Message); } finally { // Close the streams and // close the file. sWriter.Close(); cStream.Close(); fStream.Close(); } } catch (CryptographicException e) { Console.WriteLine("A Cryptographic error occurred: {0}", e.Message); } catch (UnauthorizedAccessException e) { Console.WriteLine("A file error occurred: {0}", e.Message); } } public static string DecryptTextFromFile(String FileName, byte[] Key, byte[] IV) { try { // Create or open the specified file. FileStream fStream = File.Open(FileName, FileMode.OpenOrCreate); // Create a new Rijndael object. Rijndael RijndaelAlg = Rijndael.Create(); // Create a CryptoStream using the FileStream // and the passed key and initialization vector (IV). CryptoStream cStream = new CryptoStream(fStream, RijndaelAlg.CreateDecryptor(Key, IV), CryptoStreamMode.Read); // Create a StreamReader using the CryptoStream. StreamReader sReader = new StreamReader(cStream); string val = null; try { // Read the data from the stream // to decrypt it. val = sReader.ReadLine(); } catch (Exception e) { Console.WriteLine("An error occurred: {0}", e.Message); } finally { // Close the streams and // close the file. sReader.Close(); cStream.Close(); fStream.Close(); } // Return the string. return val; } catch (CryptographicException e) { Console.WriteLine("A Cryptographic error occurred: {0}", e.Message); return null; } catch (UnauthorizedAccessException e) { Console.WriteLine("A file error occurred: {0}", e.Message); return null; } } }

System.Security.Cryptography.SymmetricAlgorithm
System.Security.Cryptography.Rijndael
System.Security.Cryptography.RijndaelManaged


Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Rijndael コンストラクタ
アセンブリ: mscorlib (mscorlib.dll 内)


抽象クラスのインスタンスは作成できません。アプリケーション コードは、派生クラスの新しいインスタンスを作成します。
このメソッドは、SymmetricAlgorithm のプロテクト フィールドを次の表に示す既定値で初期化します。

Rijndael クラスを使用してデータを暗号化し、復号化する方法を次のコード例に示します。
Imports System.Security.Cryptography Imports System.Text Imports System.IO Module RijndaelSample Sub Main() Try ' Create a new Rijndael object to generate a key ' and initialization vector (IV). Dim RijndaelAlg As Rijndael = Rijndael.Create ' Create a string to encrypt. Dim sData As String = "Here is some data to encrypt." Dim FileName As String = "CText.txt" ' Encrypt text to a file using the file name, key, and IV. EncryptTextToFile(sData, FileName, RijndaelAlg.Key, RijndaelAlg.IV) ' Decrypt the text from a file using the file name, key, and IV. Dim Final As String = DecryptTextFromFile(FileName, RijndaelAlg.Key, RijndaelAlg.IV) ' Display the decrypted string to the console. Console.WriteLine(Final) Catch e As Exception Console.WriteLine(e.Message) End Try Console.ReadLine() End Sub Sub EncryptTextToFile(ByVal Data As String, ByVal FileName As String, ByVal Key() As Byte, ByVal IV() As Byte) Try ' Create or open the specified file. Dim fStream As FileStream = File.Open(FileName, FileMode.OpenOrCreate) ' Create a new Rijndael object. Dim RijndaelAlg As Rijndael = Rijndael.Create ' Create a CryptoStream using the FileStream ' and the passed key and initialization vector (IV). Dim cStream As New CryptoStream(fStream, _ RijndaelAlg.CreateEncryptor(Key, IV), _ CryptoStreamMode.Write) ' Create a StreamWriter using the CryptoStream. Dim sWriter As New StreamWriter(cStream) Try ' Write the data to the stream ' to encrypt it. sWriter.WriteLine(Data) Catch e As Exception Console.WriteLine("An error occurred: {0}", e.Message) Finally ' Close the streams and ' close the file. sWriter.Close() cStream.Close() fStream.Close() End Try Catch e As CryptographicException Console.WriteLine("A Cryptographic error occurred: {0}", e.Message) Catch e As UnauthorizedAccessException Console.WriteLine("A file error occurred: {0}", e.Message) End Try End Sub Function DecryptTextFromFile(ByVal FileName As String, ByVal Key() As Byte, ByVal IV() As Byte) As String Try ' Create or open the specified file. Dim fStream As FileStream = File.Open(FileName, FileMode.OpenOrCreate) ' Create a new Rijndael object. Dim RijndaelAlg As Rijndael = Rijndael.Create ' Create a CryptoStream using the FileStream ' and the passed key and initialization vector (IV). Dim cStream As New CryptoStream(fStream, _ RijndaelAlg.CreateDecryptor(Key, IV), _ CryptoStreamMode.Read) ' Create a StreamReader using the CryptoStream. Dim sReader As New StreamReader(cStream) ' Read the data from the stream ' to decrypt it. Dim val As String = Nothing Try val = sReader.ReadLine() Catch e As Exception Console.WriteLine("An Cerror occurred: {0}", e.Message) Finally ' Close the streams and ' close the file. sReader.Close() cStream.Close() fStream.Close() End Try ' Return the string. Return val Catch e As CryptographicException Console.WriteLine("A Cryptographic error occurred: {0}", e.Message) Return Nothing Catch e As UnauthorizedAccessException Console.WriteLine("A file error occurred: {0}", e.Message) Return Nothing End Try End Function End Module
using System; using System.Security.Cryptography; using System.Text; using System.IO; class RijndaelSample { static void Main() { try { // Create a new Rijndael object to generate a key // and initialization vector (IV). Rijndael RijndaelAlg = Rijndael.Create(); // Create a string to encrypt. string sData = "Here is some data to encrypt."; string FileName = "CText.txt"; // Encrypt text to a file using the file name, key, and IV. EncryptTextToFile(sData, FileName, RijndaelAlg.Key, RijndaelAlg.IV); // Decrypt the text from a file using the file name, key, and IV. string Final = DecryptTextFromFile(FileName, RijndaelAlg.Key, RijndaelAlg.IV); // Display the decrypted string to the console. Console.WriteLine(Final); } catch (Exception e) { Console.WriteLine(e.Message); } Console.ReadLine(); } public static void EncryptTextToFile(String Data, String FileName, byte[] Key, byte[] IV) { try { // Create or open the specified file. FileStream fStream = File.Open(FileName, FileMode.OpenOrCreate); // Create a new Rijndael object. Rijndael RijndaelAlg = Rijndael.Create(); // Create a CryptoStream using the FileStream // and the passed key and initialization vector (IV). CryptoStream cStream = new CryptoStream(fStream, RijndaelAlg.CreateEncryptor(Key, IV), CryptoStreamMode.Write); // Create a StreamWriter using the CryptoStream. StreamWriter sWriter = new StreamWriter(cStream); try { // Write the data to the stream // to encrypt it. sWriter.WriteLine(Data); } catch (Exception e) { Console.WriteLine("An error occurred: {0}", e.Message); } finally { // Close the streams and // close the file. sWriter.Close(); cStream.Close(); fStream.Close(); } } catch (CryptographicException e) { Console.WriteLine("A Cryptographic error occurred: {0}", e.Message); } catch (UnauthorizedAccessException e) { Console.WriteLine("A file error occurred: {0}", e.Message); } } public static string DecryptTextFromFile(String FileName, byte[] Key, byte[] IV) { try { // Create or open the specified file. FileStream fStream = File.Open(FileName, FileMode.OpenOrCreate); // Create a new Rijndael object. Rijndael RijndaelAlg = Rijndael.Create(); // Create a CryptoStream using the FileStream // and the passed key and initialization vector (IV). CryptoStream cStream = new CryptoStream(fStream, RijndaelAlg.CreateDecryptor(Key, IV), CryptoStreamMode.Read); // Create a StreamReader using the CryptoStream. StreamReader sReader = new StreamReader(cStream); string val = null; try { // Read the data from the stream // to decrypt it. val = sReader.ReadLine(); } catch (Exception e) { Console.WriteLine("An error occurred: {0}", e.Message); } finally { // Close the streams and // close the file. sReader.Close(); cStream.Close(); fStream.Close(); } // Return the string. return val; } catch (CryptographicException e) { Console.WriteLine("A Cryptographic error occurred: {0}", e.Message); return null; } catch (UnauthorizedAccessException e) { Console.WriteLine("A file error occurred: {0}", e.Message); return null; } } }

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Rijndael フィールド

名前 | 説明 | |
---|---|---|
![]() | BlockSizeValue | 暗号操作のブロック サイズをビット単位で表します。 ( SymmetricAlgorithm から継承されます。) |
![]() | FeedbackSizeValue | 暗号操作のフィードバック サイズをビット単位で表します。 ( SymmetricAlgorithm から継承されます。) |
![]() | IVValue | 対称アルゴリズムで使用する初期化ベクタ (IV) を表します。 ( SymmetricAlgorithm から継承されます。) |
![]() | KeySizeValue | 対称アルゴリズムで使用する共有キーのサイズをビット単位で表します。 ( SymmetricAlgorithm から継承されます。) |
![]() | KeyValue | 対称アルゴリズムの共有キーを表します。 ( SymmetricAlgorithm から継承されます。) |
![]() | LegalBlockSizesValue | 対称アルゴリズムでサポートされているブロック サイズを指定します。 ( SymmetricAlgorithm から継承されます。) |
![]() | LegalKeySizesValue | 対称アルゴリズムでサポートされているキー サイズを指定します。 ( SymmetricAlgorithm から継承されます。) |
![]() | ModeValue | 対称アルゴリズムで使用する暗号モードを表します。 ( SymmetricAlgorithm から継承されます。) |
![]() | PaddingValue | 対称アルゴリズムで使用する埋め込みモードを表します。 ( SymmetricAlgorithm から継承されます。) |

Rijndael プロパティ

名前 | 説明 | |
---|---|---|
![]() | BlockSize | 暗号操作のブロック サイズをビット単位で取得または設定します。 ( SymmetricAlgorithm から継承されます。) |
![]() | FeedbackSize | 暗号操作のフィードバック サイズをビット単位で取得または設定します。 ( SymmetricAlgorithm から継承されます。) |
![]() | IV | 対称アルゴリズムの初期化ベクタ (IV) を取得または設定します。 ( SymmetricAlgorithm から継承されます。) |
![]() | Key | 対称アルゴリズムの共有キーを取得または設定します。 ( SymmetricAlgorithm から継承されます。) |
![]() | KeySize | 対称アルゴリズムで使用する共有キーのサイズをビット単位で取得または設定します。 ( SymmetricAlgorithm から継承されます。) |
![]() | LegalBlockSizes | 対称アルゴリズムでサポートされているブロック サイズを取得します。 ( SymmetricAlgorithm から継承されます。) |
![]() | LegalKeySizes | 対称アルゴリズムでサポートされているキー サイズを取得します。 ( SymmetricAlgorithm から継承されます。) |
![]() | Mode | 対称アルゴリズムの操作モードを取得または設定します。 ( SymmetricAlgorithm から継承されます。) |
![]() | Padding | 対称アルゴリズムで使用する埋め込みモードを取得または設定します。 ( SymmetricAlgorithm から継承されます。) |

Rijndael メソッド

名前 | 説明 | |
---|---|---|
![]() | Clear | SymmetricAlgorithm クラスによって使用されているすべてのリソースを解放します。 ( SymmetricAlgorithm から継承されます。) |
![]() | Create | オーバーロードされます。 Rijndael アルゴリズムを実行する暗号オブジェクトを作成します。 |
![]() | CreateDecryptor | オーバーロードされます。 対称復号化オブジェクトを作成します。 ( SymmetricAlgorithm から継承されます。) |
![]() | CreateEncryptor | オーバーロードされます。 対称暗号化オブジェクトを作成します。 ( SymmetricAlgorithm から継承されます。) |
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。) |
![]() | GenerateIV | 派生クラスでオーバーライドされると、アルゴリズムで使用するランダムな初期化ベクタ (IV) を生成します。 ( SymmetricAlgorithm から継承されます。) |
![]() | GenerateKey | 派生クラスでオーバーライドされると、アルゴリズムで使用するランダム キー (Key) を生成します。 ( SymmetricAlgorithm から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 ( Object から継承されます。) |
![]() | ValidKeySize | 指定されたキー サイズが、現在のアルゴリズムに対して有効かどうかを判断します。 ( SymmetricAlgorithm から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Dispose | SymmetricAlgorithm によって使用されているアンマネージ リソースを解放し、オプションでマネージ リソースも解放します。 ( SymmetricAlgorithm から継承されます。) |
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |

Rijndael メンバ
Rijndael 対称暗号化アルゴリズムのすべての実装の継承元となる基本クラスを表します。
Rijndael データ型で公開されるメンバを以下の表に示します。


名前 | 説明 | |
---|---|---|
![]() | BlockSizeValue | 暗号操作のブロック サイズをビット単位で表します。(SymmetricAlgorithm から継承されます。) |
![]() | FeedbackSizeValue | 暗号操作のフィードバック サイズをビット単位で表します。(SymmetricAlgorithm から継承されます。) |
![]() | IVValue | 対称アルゴリズムで使用する初期化ベクタ (IV) を表します。(SymmetricAlgorithm から継承されます。) |
![]() | KeySizeValue | 対称アルゴリズムで使用する共有キーのサイズをビット単位で表します。(SymmetricAlgorithm から継承されます。) |
![]() | KeyValue | 対称アルゴリズムの共有キーを表します。(SymmetricAlgorithm から継承されます。) |
![]() | LegalBlockSizesValue | 対称アルゴリズムでサポートされているブロック サイズを指定します。(SymmetricAlgorithm から継承されます。) |
![]() | LegalKeySizesValue | 対称アルゴリズムでサポートされているキー サイズを指定します。(SymmetricAlgorithm から継承されます。) |
![]() | ModeValue | 対称アルゴリズムで使用する暗号モードを表します。(SymmetricAlgorithm から継承されます。) |
![]() | PaddingValue | 対称アルゴリズムで使用する埋め込みモードを表します。(SymmetricAlgorithm から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | BlockSize | 暗号操作のブロック サイズをビット単位で取得または設定します。(SymmetricAlgorithm から継承されます。) |
![]() | FeedbackSize | 暗号操作のフィードバック サイズをビット単位で取得または設定します。(SymmetricAlgorithm から継承されます。) |
![]() | IV | 対称アルゴリズムの初期化ベクタ (IV) を取得または設定します。(SymmetricAlgorithm から継承されます。) |
![]() | Key | 対称アルゴリズムの共有キーを取得または設定します。(SymmetricAlgorithm から継承されます。) |
![]() | KeySize | 対称アルゴリズムで使用する共有キーのサイズをビット単位で取得または設定します。(SymmetricAlgorithm から継承されます。) |
![]() | LegalBlockSizes | 対称アルゴリズムでサポートされているブロック サイズを取得します。(SymmetricAlgorithm から継承されます。) |
![]() | LegalKeySizes | 対称アルゴリズムでサポートされているキー サイズを取得します。(SymmetricAlgorithm から継承されます。) |
![]() | Mode | 対称アルゴリズムの操作モードを取得または設定します。(SymmetricAlgorithm から継承されます。) |
![]() | Padding | 対称アルゴリズムで使用する埋め込みモードを取得または設定します。(SymmetricAlgorithm から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Clear | SymmetricAlgorithm クラスによって使用されているすべてのリソースを解放します。 (SymmetricAlgorithm から継承されます。) |
![]() | Create | オーバーロードされます。 Rijndael アルゴリズムを実行する暗号オブジェクトを作成します。 |
![]() | CreateDecryptor | オーバーロードされます。 対称復号化オブジェクトを作成します。 (SymmetricAlgorithm から継承されます。) |
![]() | CreateEncryptor | オーバーロードされます。 対称暗号化オブジェクトを作成します。 (SymmetricAlgorithm から継承されます。) |
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。) |
![]() | GenerateIV | 派生クラスでオーバーライドされると、アルゴリズムで使用するランダムな初期化ベクタ (IV) を生成します。 (SymmetricAlgorithm から継承されます。) |
![]() | GenerateKey | 派生クラスでオーバーライドされると、アルゴリズムで使用するランダム キー (Key) を生成します。 (SymmetricAlgorithm から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 (Object から継承されます。) |
![]() | ValidKeySize | 指定されたキー サイズが、現在のアルゴリズムに対して有効かどうかを判断します。 (SymmetricAlgorithm から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Dispose | SymmetricAlgorithm によって使用されているアンマネージ リソースを解放し、オプションでマネージ リソースも解放します。 (SymmetricAlgorithm から継承されます。) |
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |

Advanced Encryption Standard
(Rijndael から転送)
出典: フリー百科事典『ウィキペディア(Wikipedia)』 (2025/08/09 02:48 UTC 版)
![]()
The SubBytes step, one of four stages in a round of AES
|
|
一般 | |
---|---|
設計者 | フィンセント・ライメン, ホァン・ダーメン |
初版発行日 | 1998 |
派生元 | Square |
後継 | Anubis, Grand Cru |
認証 | AES採用, CRYPTREC, NESSIE, NSA |
暗号詳細 | |
鍵長 | 128, 192 or 256 bits[1] |
ブロック長 | 128 bits[2] |
構造 | SPN構造 |
ラウンド数 | 10, 12, 14(鍵長による) |
最良の暗号解読法 | |
完全な総当たり攻撃よりも計算量の多い攻撃が発表されているが、2013年時点では計算量が少ない攻撃は見つかっていない:[3] AES-128については、完全2部グラフ(Biclique)を使用すると2126.1の計算量で鍵を復元することが可能である。AES-192とAES-256に対するBiclique攻撃では、それぞれ2189.7と2254.4の計算複雑度が適用される。関連鍵攻撃では、AES-192とAES-256をそれぞれ2176と299.5の複雑さで破ることができる。 |
Advanced Encryption Standard (AES) は、アメリカが2001年に標準暗号として定めた共通鍵暗号アルゴリズムである。アメリカ国立標準技術研究所(NIST)が公募し、Rijndael(ラインダール)がAESとして採用された[4]。
概要
AES以前の標準暗号であったDESは、次の2点が問題であった。
そこで、新しい標準暗号がアメリカ国立標準技術研究所(NIST)の主導によって公募され、AESが選出された。2001年3月に FIPS PUB 197 として公表された。
厳密には「AES」は、選出されなかった暗号も含む、手続き期間中から使われた「新しい標準暗号」の総称であり、選出された暗号方式自体の名はRijndael(ラインダール)である。
AESはSPN構造のブロック暗号である。ブロック長は128ビットであり、鍵長には128ビット・192ビット・256ビットの3種類が選択できる(鍵長が大きいほうが暗号強度が高い)。これに対し、AESの元となった Rijndael では、ブロック長と鍵長が可変であり、128ビットから256ビットまでの32ビットの倍数が選べる。NISTが公募した際のスペックに従い、米国標準となったAESではブロック長は128ビットに固定され、鍵長も3種類に限られた[5]。
経緯
AESの選定
旧規格 DES (FIPS 46) の安全性が低下したので、1997年9月にNIST(アメリカ国立標準技術研究所)が後継の暗号標準AES (Advanced Encryption Standard) とすべく共通鍵ブロック暗号を公募した。公募要件には下記のような条件が挙げられた[5]。
AESの最終候補
世界から応募された21方式から、公募要件を満たした15方式に対する評価が行われ、安全性と実装性能に優れた5方式が最終候補として残った。最終候補および設計者は下記のとおりである[5]。
- Rijndael - ホァン・ダーメン、フィンセント・ライメン
- Serpent(サーペント、または、サーパン)- ロス・アンダーソン、エリ・ビーハム、ラーズ・ヌードセン
- RC6 - ロナルド・リヴェスト、マット・ロブショー、レイ・シドニー、イーチュン・リサ・イン
- Twofish - ブルース・シュナイアー、ジョン・ケルシー、ダグ・ホワイティング、デーヴィッド・ワグナー、クリス・ホール、ニールス・ファーガソン
- Mars - カロリン・バーウィック、ドン・カッパースミス、エドワード・ダヴィニョン、ロザリオ・ジェンナロ、シャイ・ハレヴィ、チャランジット・ジュトラ、ステファン・マテリアス Jr.、ルーク・オコーナー、モハンマド・ペイラヴィアン、デヴィド・サフォード、ネヴェンコ・ズニコフ
AESの決定
最終選考の結果、あらゆる実装条件で優れた実装性能を発揮したベルギーのルーヴェン・カトリック大学の研究者ホァン・ダーメン (Joan Daemen) と フィンセント・ライメン (Vincent Rijmen) が設計した Rijndael (ラインダール)が2000年10月に採用された。
Rijndaelという名称のうち、RijnはRijmen、daeはDaemenから取られたことは明白だが、lはどこから来たのかが不明だった。指導教授だったバート・プレネル (Bart Preneel) から取ったのではという説があり、Rijmenが講演した際に質問を受けたが、その答えは "It's a conjecture.(それは憶測に過ぎないね)" だった[要出典]。
暗号化の方法
AESはSPN構造のブロック暗号で、ブロック長は128ビット、鍵長は128ビット・192ビット・256ビットの3つが利用できる[4]。
暗号化処理では、始めに鍵生成を行う。AES暗号の鍵長によって変換のラウンド数が異なる。次のとおりである。
- 鍵長128ビットのとき、ラウンド数は10回である。
- 鍵長192ビットのとき、ラウンド数は12回である。
- 鍵長256ビットのとき、ラウンド数は14回である。
暗号化は下記の4つの処理から構成される[5]。
- SubBytes - 換字表(Sボックス)による1バイト単位の置換。
- ShiftRows - 4バイト単位の行を一定規則で左シフトする。
- MixColumns - ビット演算による4バイト単位の行列変換。
- AddRoundKey - ラウンド鍵とのXORをとる。
これら4つの処理を1ラウンドとして暗号化を行う。
なお、復号は上記処理の逆変換を逆順で実行する。
- AddRoundKey
- InvMixColumns
- InvShiftRows
- InvSubBytes
安全性
関連鍵攻撃により、256ビットのAES暗号の第9ラウンドまでが解読可能である。また、選択平文攻撃により、192ビットおよび256ビットのAES暗号の第8ラウンドまで、128ビットのAES暗号の第7ラウンドまでが解読可能である (Ferguson et al., 2000)。シュナイアーはAESの「代数的単純さに疑問」を感じているが、AESは欧州の暗号規格NESSIEや日本の暗号規格CRYPTRECでも採用された。AESの数学的構造は他のブロック暗号と異なり、きちんとした記述もある[6][7]。
この暗号は暗号化方式としてはまだどんな攻撃にも屈していないが、実装によってはサイドチャネル攻撃が成功する場合がある[8][9]。
関連項目
- ブロック暗号
- 有限体
- Transport Layer Security - 暗号化として128ビットおよび256ビットのAES-CBC、AES-GCM、AES-CCMを使用可能
- ディスク暗号化
- Wii - 暗号化に128ビットAESを使用
- アーカイブファイル形式
- CCMP - WEPで用いられていたRC4、WPAで用いられていたTKIP(本質的にRC4と同等)に代わり、WPA2で採用された暗号化プロトコル。128ビットAESをCCMモードで利用
- AACS - 128ビットAESを使用
- CRYPTREC
- NESSIE
- CPUの命令セット
脚注
- ^ Rijndaelでは128, 160, 192, 224, 256 bitsが選択可能。AESのスペックに合わせて3つに限定
- ^ Rijndaelでは128, 160, 192, 224, 256 bitsが選択可能。AESのスペックに合わせて128 bitsのみに限定
- ^ “Biclique Cryptanalysis of the Full AES” (PDF) (英語). 2016年3月6日時点のオリジナルよりアーカイブ。2016年10月9日閲覧。
- ^ a b 岡本 暗号理論入門 第2版(2002:51-52)
- ^ a b c d 結城 暗号技術入門 第3版(2003: 69-71)
- ^ A simple algebraic representation of Rijndael (Niels Ferguson, Richard Schroeppel, and Doug Whiting)(2003年6月6日時点のアーカイブ)
- ^ Sean Murphy
- ^ 角尾幸保, 久保博靖, 茂真紀, 辻原悦子, 宮内宏, "S-boxにおけるキャッシュ遅延を利用したAESへのタイミング攻撃 (PDF) ", SCIS2003
- ^ Cache-timing attacks on AES (PDF) - (Daniel J. Bernstein)
参考文献
- FIPS 197 (PDF) 、NIST発行、2001年
- Daemen and Rijmen, Rijndael 仕様書(補追版) (PDF) 、1999年発行-2003年補追
- 岡本栄司『暗号理論入門』(第2版)共立出版、2002年。ISBN 4-320-12044-2。
- 結城浩『暗号技術入門 - 秘密の国のアリス』(第3版)ソフトバンクパブリッシング、2003年。 ISBN 4-7973-2297-7。
- 澤田秀樹:「暗号理論と代数学 増補・AES(高度暗号化標準) Kindle版」,(2021年9月16日).
外部リンク
- 公式サイト AES Home Page(のアーカイブ) - ウェイバックマシン(2014年7月17日アーカイブ分)
- リファレンスコード
- 解説 AES概説(2009年5月3日時点のアーカイブ)
- 選定過程 AESファイナリストをめぐって - ウェイバックマシン
- Report on the Development of the Advanced Encryption Standard
RIJNDAEL
出典: フリー百科事典『ウィキペディア(Wikipedia)』 (2022/06/13 02:48 UTC 版)
「スターソルジャー」の記事における「RIJNDAEL」の解説
ショットは後方に集中し、ブラスターは自機の前方にレーザーを放つタイプ・レーザー。
※この「RIJNDAEL」の解説は、「スターソルジャー」の解説の一部です。
「RIJNDAEL」を含む「スターソルジャー」の記事については、「スターソルジャー」の概要を参照ください。
- Rijndaelのページへのリンク