Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the default value of the iterationCount property of Rfc2898DeriveBytes class

I'm trying to implement an AES algorithm as PHP by examining a sample C# code. But i could not find the default value of the iterationCount property of Rfc2898DeriveBytes class after running this constructor :

Rfc2898DeriveBytes k2 = new Rfc2898DeriveBytes(pwd1, salt1);

constructor definition is:

Rfc2898DeriveBytes(String, Int32)

and all i have found is that : https://msdn.microsoft.com/en-us/library/1bah3ekk(v=vs.100).aspx

Could you please help me to learn what it is?

like image 320
Orhan Veli Esen Avatar asked Oct 19 '15 09:10

Orhan Veli Esen


People also ask

What is the default iteration count of rfc2898derivebytes?

//The default iteration count is 1000 so the two methods use the same iteration count. int myIterations = 1000; try { Rfc2898DeriveBytes k1 = new Rfc2898DeriveBytes (pwd1, salt1, myIterations); Rfc2898DeriveBytes k2 = new Rfc2898DeriveBytes (pwd1, salt1); // Encrypt the data.

What is the rfc2898derivebytes class used for?

The Rfc2898DeriveBytes class can be used to produce a derived key from a base key and other parameters. In a password-based key derivation function, the base key is a password and the other parameters are a salt value and an iteration count.

What is the minimum recommended number of iterations for a method?

Console.WriteLine ("k1 iterations: {0}", k1.IterationCount); Console.WriteLine ("k2 iterations: {0}", k2.IterationCount); } Iteration count is the number of times an operation is performed. For this method, the count should be greater than zero. The minimum recommended number of iterations is 1000.

What is animation-iteration-count property in CSS?

The animation-iteration-count property in CSS is used to specify the number of times the animation will be repeated. It can specify as infinite to repeat the animation indefinitely. Attention reader! Don’t stop learning now.


1 Answers

The default is 1000 as per the source code.

In addition, the minimum recommended number of iterations is 1000.

Iteration count is the number of times an operation is performed. For this method, the count should be greater than zero. The minimum recommended number of iterations is 1000.

Source

The same source also contains a commented code example which answers the question even more directly.

like image 149
DGibbs Avatar answered Oct 06 '22 14:10

DGibbs