Orhan Veli Esen Orhan Veli Esen - 10 days ago 6
C# Question

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?

Answer

The default 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.