42 [RequiresUnreferencedCode(
"The hash implementation might be removed. Ensure the referenced hash algorithm is not trimmed.")]
78 return (
byte[])
_salt?.Clone();
120 [RequiresUnreferencedCode(
"The hash implementation might be removed. Ensure the referenced hash algorithm is not trimmed.")]
122 : this(strPassword, rgbSalt, strHashName, iterations, new
CspParameters())
126 [RequiresUnreferencedCode(
"The hash implementation might be removed. Ensure the referenced hash algorithm is not trimmed.")]
128 : this(password, salt, hashName, iterations, new
CspParameters())
132 [UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2026:RequiresUnreferencedCode", Justification =
"The correct hash algorithm is being preserved by the DynamicDependency.")]
135 : this(strPassword, rgbSalt,
"SHA1", 100, cspParams)
139 [UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2026:RequiresUnreferencedCode", Justification =
"The correct hash algorithm is being preserved by the DynamicDependency.")]
142 : this(password, salt,
"SHA1", 100, cspParams)
146 [RequiresUnreferencedCode(
"The hash implementation might be removed. Ensure the referenced hash algorithm is not trimmed.")]
148 : this(new
UTF8Encoding(encoderShouldEmitUTF8Identifier: false).
GetBytes(strPassword), rgbSalt, strHashName, iterations, cspParams)
152 [RequiresUnreferencedCode(
"The hash implementation might be removed. Ensure the referenced hash algorithm is not trimmed.")]
162 [Obsolete(
"Rfc2898DeriveBytes replaces PasswordDeriveBytes for deriving key material from a password and is preferred in new applications.")]
166 byte[]
array =
new byte[cb];
192 if (array2.Length + num > cb)
207 protected override void Dispose(
bool disposing)
209 base.Dispose(disposing);
255 int num2 = _hash.HashSize / 8;
256 byte[]
array =
new byte[(cb + num2 - 1) / num2 * num2];
261 cryptoStream.
Close();
264 for (num += num2; cb > num; num += num2)
271 cryptoStream2.
Close();
285 byte[]
array =
new byte[3] { 48, 48, 48 };
305 [SupportedOSPlatform(
"windows")]
306 public byte[]
CryptDeriveKey(
string? algname,
string? alghashname,
int keySize,
byte[] rgbIV)
333 if (cspParams ==
null)
338 return safeProvHandle;
static void AcquireCsp(CspParameters cspParameters, out SafeProvHandle safeProvHandle)
static int NameOrOidToHashAlgId(string nameOrOid, OidGroup oidGroup)
static void DeriveKey(SafeProvHandle hProv, int algid, int algidHash, byte[] password, int cbPassword, int dwFlags, byte[] IV_Out, int cbIV_In, [NotNull] ref byte[] pbKey)
static unsafe void Clear(Array array)
static void BlockCopy(Array src, int srcOffset, Array dst, int dstOffset, int count)
static readonly Stream Null
static string Cryptography_PasswordDerivedBytes_InvalidAlgorithm
static string ArgumentOutOfRange_NeedPosNum
static string Cryptography_PasswordDerivedBytes_ValuesFixed
static string Cryptography_InvalidKeySize
static string Cryptography_PasswordDerivedBytes_TooManyBytes
static string Cryptography_PasswordDerivedBytes_InvalidIV
static ? object CreateFromName(string name, params object?[]? args)
override void Write(byte[] buffer, int offset, int count)
byte[] TransformFinalBlock(byte[] inputBuffer, int inputOffset, int inputCount)
int TransformBlock(byte[] inputBuffer, int inputOffset, int inputCount, byte[]? outputBuffer, int outputOffset)
byte[] ComputeHash(byte[] buffer)
byte[] ComputeBytes(int cb)
PasswordDeriveBytes(string strPassword, byte[]? rgbSalt, string strHashName, int iterations)
readonly CspParameters _cspParams
PasswordDeriveBytes(byte[] password, byte[]? salt, CspParameters? cspParams)
SafeProvHandle ProvHandle
PasswordDeriveBytes(string strPassword, byte[]? rgbSalt)
override byte[] GetBytes(int cb)
PasswordDeriveBytes(string strPassword, byte[]? rgbSalt, CspParameters? cspParams)
static SafeProvHandle AcquireSafeProviderHandle(CspParameters cspParams)
byte[] ComputeBaseValue()
readonly byte[] _password
PasswordDeriveBytes(byte[] password, byte[]? salt, string hashName, int iterations, CspParameters? cspParams)
byte[] CryptDeriveKey(string? algname, string? alghashname, int keySize, byte[] rgbIV)
SafeProvHandle _safeProvHandle
PasswordDeriveBytes(string strPassword, byte[]? rgbSalt, string strHashName, int iterations, CspParameters? cspParams)
PasswordDeriveBytes(byte[] password, byte[]? salt, string hashName, int iterations)
override void Dispose(bool disposing)
PasswordDeriveBytes(byte[] password, byte[]? salt)
void HashPrefix(CryptoStream cs)
static void MemoryBarrier()
DynamicallyAccessedMemberTypes