Rfc2898DeriveBytes.Salt プロパティ
アセンブリ: mscorlib (mscorlib.dll 内)
構文
public: property array<unsigned char>^ Salt { array<unsigned char>^ get (); void set (array<unsigned char>^ value); }
演算で使用するキー salt 値。
salt は、メッセージを不正に復号化することを、より困難にするためのランダムなバイト データです。辞書攻撃とは、暗号化された値を、使用される可能性の高そうなキーに対してあらかじめ算出しておいた多数の暗号化値と比較することによって、暗号化されたメッセージを復号化しようとする攻撃です。この攻撃への対処法としては、キーを派生させる前に、パスワードの末尾に salt (ランダム バイト) を追加します。
Rfc2898DeriveBytes クラスを使用して、TripleDES クラスのまったく同じ 2 つのキーを作成するコード例を次に示します。次に、このキーを使用して、一部のデータを暗号化および復号化します。
string pwd1 = passwordargs[0]; byte[] salt1 = new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0xF1, 0xF0, 0xEE, 0x21, 0x22, 0x45}; //data1 can be a string or contents of a file. string data1 = "Some test data"; //The default iteration count is 1000 so the two methods use the same iteration count. int myIterations = 1000;
String^ pwd1 = passwordargs[ 1 ]; array<Byte>^salt1 = gcnew array<Byte>{ 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0xF1,0xF0,0xEE,0x21,0x22,0x45 }; //data1 can be a string or contents of a file. String^ data1 = "Some test data"; //The default iteration count is 1000 so the two methods use the same iteration count. int myIterations = 1000;
String pwd1 = (String)passwordArgs.get_Item(0); ubyte salt1[] = new ubyte[] { 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6 , 0xF1, 0xF0, 0xEE, 0x21, 0x22, 0x45 }; //data1 can be a string or contents of a file. String data1 = "Some test data"; //The default iteration count is 1000 so the two methods use the //same iteration count. int myIterations = 1000;
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
Weblioに収録されているすべての辞書からRfc2898DeriveBytes.Salt プロパティを検索する場合は、下記のリンクをクリックしてください。
全ての辞書からRfc2898DeriveBytes.Salt プロパティを検索
- Rfc2898DeriveBytes.Salt プロパティのページへのリンク