Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Rfc2898DeriveBytes() [8/9]

System.Security.Cryptography.Rfc2898DeriveBytes.Rfc2898DeriveBytes ( string password,
int saltSize,
int iterations,
HashAlgorithmName hashAlgorithm )
inline

Definition at line 102 of file Rfc2898DeriveBytes.cs.

103 {
104 if (saltSize < 0)
105 {
106 throw new ArgumentOutOfRangeException("saltSize", System.SR.ArgumentOutOfRange_NeedNonNegNum);
107 }
108 if (iterations <= 0)
109 {
110 throw new ArgumentOutOfRangeException("iterations", System.SR.ArgumentOutOfRange_NeedPosNum);
111 }
112 _salt = new byte[saltSize + 4];
113 RandomNumberGenerator.Fill(_salt.AsSpan(0, saltSize));
114 _iterations = (uint)iterations;
115 byte[] bytes = Encoding.UTF8.GetBytes(password);
116 HashAlgorithm = hashAlgorithm;
118 CryptographicOperations.ZeroMemory(bytes);
119 _blockSize = _hmac.HashSize >> 3;
120 Initialize();
121 }
static string ArgumentOutOfRange_NeedPosNum
Definition SR.cs:20
static string ArgumentOutOfRange_NeedNonNegNum
Definition SR.cs:32
Definition SR.cs:7
static Encoding UTF8
Definition Encoding.cs:526

References System.Security.Cryptography.Rfc2898DeriveBytes._blockSize, System.Security.Cryptography.Rfc2898DeriveBytes._hmac, System.Security.Cryptography.Rfc2898DeriveBytes._iterations, System.Security.Cryptography.Rfc2898DeriveBytes._salt, System.SR.ArgumentOutOfRange_NeedNonNegNum, System.SR.ArgumentOutOfRange_NeedPosNum, System.bytes, System.Security.Cryptography.RandomNumberGenerator.Fill(), System.Security.Cryptography.Rfc2898DeriveBytes.Initialize(), System.Security.Cryptography.Rfc2898DeriveBytes.OpenHmac(), System.Text.Encoding.UTF8, and System.Security.Cryptography.CryptographicOperations.ZeroMemory().