Rfc2898DeriveBytes.Pbkdf2 方法

定義

多載

Pbkdf2(Byte[], Byte[], Int32, HashAlgorithmName, Int32)

從密碼位元組建立 PBKDF2 衍生金鑰。

Pbkdf2(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Int32, HashAlgorithmName, Int32)

從密碼位元組建立 PBKDF2 衍生金鑰。

Pbkdf2(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Span<Byte>, Int32, HashAlgorithmName)

使用 PBKDF2 衍生金鑰填入緩衝區。

Pbkdf2(ReadOnlySpan<Char>, ReadOnlySpan<Byte>, Int32, HashAlgorithmName, Int32)

從密碼建立 PBKDF2 衍生的金鑰。

Pbkdf2(ReadOnlySpan<Char>, ReadOnlySpan<Byte>, Span<Byte>, Int32, HashAlgorithmName)

使用 PBKDF2 衍生金鑰填入緩衝區。

Pbkdf2(String, Byte[], Int32, HashAlgorithmName, Int32)

從密碼建立 PBKDF2 衍生的金鑰。

Pbkdf2(Byte[], Byte[], Int32, HashAlgorithmName, Int32)

來源:
Rfc2898DeriveBytes.OneShot.cs
來源:
Rfc2898DeriveBytes.OneShot.cs
來源:
Rfc2898DeriveBytes.OneShot.cs

從密碼位元組建立 PBKDF2 衍生金鑰。

public:
 static cli::array <System::Byte> ^ Pbkdf2(cli::array <System::Byte> ^ password, cli::array <System::Byte> ^ salt, int iterations, System::Security::Cryptography::HashAlgorithmName hashAlgorithm, int outputLength);
public static byte[] Pbkdf2 (byte[] password, byte[] salt, int iterations, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, int outputLength);
static member Pbkdf2 : byte[] * byte[] * int * System.Security.Cryptography.HashAlgorithmName * int -> byte[]
Public Shared Function Pbkdf2 (password As Byte(), salt As Byte(), iterations As Integer, hashAlgorithm As HashAlgorithmName, outputLength As Integer) As Byte()

參數

password
Byte[]

用來衍生金鑰的密碼。

salt
Byte[]

用來衍生金鑰的金鑰 Salt。

iterations
Int32

操作的重複次數。

hashAlgorithm
HashAlgorithmName

要用來衍生金鑰的雜湊演算法。

outputLength
Int32

要衍生的金鑰大小。

傳回

Byte[]

位元組陣列,其中包含已建立的 PBKDF2 衍生金鑰。

例外狀況

passwordsaltnull

outputLength 不是零或正值。

-或-

iterations 不是正值。

hashAlgorithmName具有空的 或 null

hashAlgorithm 是不支援的雜湊演算法。 支援的演算法為 SHA1SHA256SHA384SHA512

適用於

Pbkdf2(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Int32, HashAlgorithmName, Int32)

來源:
Rfc2898DeriveBytes.OneShot.cs
來源:
Rfc2898DeriveBytes.OneShot.cs
來源:
Rfc2898DeriveBytes.OneShot.cs

從密碼位元組建立 PBKDF2 衍生金鑰。

public:
 static cli::array <System::Byte> ^ Pbkdf2(ReadOnlySpan<System::Byte> password, ReadOnlySpan<System::Byte> salt, int iterations, System::Security::Cryptography::HashAlgorithmName hashAlgorithm, int outputLength);
public static byte[] Pbkdf2 (ReadOnlySpan<byte> password, ReadOnlySpan<byte> salt, int iterations, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, int outputLength);
static member Pbkdf2 : ReadOnlySpan<byte> * ReadOnlySpan<byte> * int * System.Security.Cryptography.HashAlgorithmName * int -> byte[]
Public Shared Function Pbkdf2 (password As ReadOnlySpan(Of Byte), salt As ReadOnlySpan(Of Byte), iterations As Integer, hashAlgorithm As HashAlgorithmName, outputLength As Integer) As Byte()

參數

password
ReadOnlySpan<Byte>

用來衍生金鑰的密碼。

salt
ReadOnlySpan<Byte>

用來衍生金鑰的金鑰 Salt。

iterations
Int32

操作的重複次數。

hashAlgorithm
HashAlgorithmName

要用來衍生金鑰的雜湊演算法。

outputLength
Int32

要衍生的金鑰大小。

傳回

Byte[]

位元組陣列,其中包含已建立的 PBKDF2 衍生金鑰。

例外狀況

outputLength 不是零或正值。

-或-

iterations 不是正值。

hashAlgorithmName具有空的 或 null

hashAlgorithm 是不支援的雜湊演算法。 支援的演算法為 SHA1SHA256SHA384SHA512

適用於

Pbkdf2(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Span<Byte>, Int32, HashAlgorithmName)

來源:
Rfc2898DeriveBytes.OneShot.cs
來源:
Rfc2898DeriveBytes.OneShot.cs
來源:
Rfc2898DeriveBytes.OneShot.cs

使用 PBKDF2 衍生金鑰填入緩衝區。

public:
 static void Pbkdf2(ReadOnlySpan<System::Byte> password, ReadOnlySpan<System::Byte> salt, Span<System::Byte> destination, int iterations, System::Security::Cryptography::HashAlgorithmName hashAlgorithm);
public static void Pbkdf2 (ReadOnlySpan<byte> password, ReadOnlySpan<byte> salt, Span<byte> destination, int iterations, System.Security.Cryptography.HashAlgorithmName hashAlgorithm);
static member Pbkdf2 : ReadOnlySpan<byte> * ReadOnlySpan<byte> * Span<byte> * int * System.Security.Cryptography.HashAlgorithmName -> unit
Public Shared Sub Pbkdf2 (password As ReadOnlySpan(Of Byte), salt As ReadOnlySpan(Of Byte), destination As Span(Of Byte), iterations As Integer, hashAlgorithm As HashAlgorithmName)

參數

password
ReadOnlySpan<Byte>

用來衍生金鑰的密碼。

salt
ReadOnlySpan<Byte>

用來衍生金鑰的金鑰 Salt。

destination
Span<Byte>

要填入衍生索引鍵的緩衝區。

iterations
Int32

操作的重複次數。

hashAlgorithm
HashAlgorithmName

要用來衍生金鑰的雜湊演算法。

例外狀況

iterations 不是正值。

hashAlgorithmName具有空的 或 null

hashAlgorithm 是不支援的雜湊演算法。 支援的演算法為 SHA1SHA256SHA384SHA512

適用於

Pbkdf2(ReadOnlySpan<Char>, ReadOnlySpan<Byte>, Int32, HashAlgorithmName, Int32)

來源:
Rfc2898DeriveBytes.OneShot.cs
來源:
Rfc2898DeriveBytes.OneShot.cs
來源:
Rfc2898DeriveBytes.OneShot.cs

從密碼建立 PBKDF2 衍生的金鑰。

public:
 static cli::array <System::Byte> ^ Pbkdf2(ReadOnlySpan<char> password, ReadOnlySpan<System::Byte> salt, int iterations, System::Security::Cryptography::HashAlgorithmName hashAlgorithm, int outputLength);
public static byte[] Pbkdf2 (ReadOnlySpan<char> password, ReadOnlySpan<byte> salt, int iterations, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, int outputLength);
static member Pbkdf2 : ReadOnlySpan<char> * ReadOnlySpan<byte> * int * System.Security.Cryptography.HashAlgorithmName * int -> byte[]
Public Shared Function Pbkdf2 (password As ReadOnlySpan(Of Char), salt As ReadOnlySpan(Of Byte), iterations As Integer, hashAlgorithm As HashAlgorithmName, outputLength As Integer) As Byte()

參數

password
ReadOnlySpan<Char>

用來衍生金鑰的密碼。

salt
ReadOnlySpan<Byte>

用來衍生金鑰的金鑰 Salt。

iterations
Int32

操作的重複次數。

hashAlgorithm
HashAlgorithmName

要用來衍生金鑰的雜湊演算法。

outputLength
Int32

要衍生的金鑰大小。

傳回

Byte[]

長度 outputLength 的位元組陣列,以虛擬隨機索引鍵位元組填入。

例外狀況

outputLength 不是零或正值。

-或-

iterations 不是正值。

hashAlgorithmName具有空的 或 null

hashAlgorithm 是不支援的雜湊演算法。 支援的演算法為 SHA1SHA256SHA384SHA512

password 包含無法轉換成 UTF8 的文字。

備註

password將使用 UTF8 編碼轉換成位元組。 針對其他編碼方式,請使用適當的 Encoding 將密碼字串轉換為位元組,並使用 Pbkdf2(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Int32, HashAlgorithmName, Int32)

適用於

Pbkdf2(ReadOnlySpan<Char>, ReadOnlySpan<Byte>, Span<Byte>, Int32, HashAlgorithmName)

來源:
Rfc2898DeriveBytes.OneShot.cs
來源:
Rfc2898DeriveBytes.OneShot.cs
來源:
Rfc2898DeriveBytes.OneShot.cs

使用 PBKDF2 衍生金鑰填入緩衝區。

public:
 static void Pbkdf2(ReadOnlySpan<char> password, ReadOnlySpan<System::Byte> salt, Span<System::Byte> destination, int iterations, System::Security::Cryptography::HashAlgorithmName hashAlgorithm);
public static void Pbkdf2 (ReadOnlySpan<char> password, ReadOnlySpan<byte> salt, Span<byte> destination, int iterations, System.Security.Cryptography.HashAlgorithmName hashAlgorithm);
static member Pbkdf2 : ReadOnlySpan<char> * ReadOnlySpan<byte> * Span<byte> * int * System.Security.Cryptography.HashAlgorithmName -> unit
Public Shared Sub Pbkdf2 (password As ReadOnlySpan(Of Char), salt As ReadOnlySpan(Of Byte), destination As Span(Of Byte), iterations As Integer, hashAlgorithm As HashAlgorithmName)

參數

password
ReadOnlySpan<Char>

用來衍生金鑰的密碼。

salt
ReadOnlySpan<Byte>

用來衍生金鑰的金鑰 Salt。

destination
Span<Byte>

要填入衍生索引鍵的緩衝區。

iterations
Int32

操作的重複次數。

hashAlgorithm
HashAlgorithmName

要用來衍生金鑰的雜湊演算法。

例外狀況

iterations 不是正值。

hashAlgorithmName具有空的 或 null

hashAlgorithm 是不支援的雜湊演算法。 支援的演算法為 SHA1SHA256SHA384SHA512

password 包含無法轉換成 UTF8 的文字。

備註

password將使用 UTF8 編碼轉換成位元組。 針對其他編碼方式,請使用適當的 Encoding 將密碼字串轉換為位元組,並使用 Pbkdf2(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Span<Byte>, Int32, HashAlgorithmName)

適用於

Pbkdf2(String, Byte[], Int32, HashAlgorithmName, Int32)

來源:
Rfc2898DeriveBytes.OneShot.cs
來源:
Rfc2898DeriveBytes.OneShot.cs
來源:
Rfc2898DeriveBytes.OneShot.cs

從密碼建立 PBKDF2 衍生的金鑰。

public:
 static cli::array <System::Byte> ^ Pbkdf2(System::String ^ password, cli::array <System::Byte> ^ salt, int iterations, System::Security::Cryptography::HashAlgorithmName hashAlgorithm, int outputLength);
public static byte[] Pbkdf2 (string password, byte[] salt, int iterations, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, int outputLength);
static member Pbkdf2 : string * byte[] * int * System.Security.Cryptography.HashAlgorithmName * int -> byte[]
Public Shared Function Pbkdf2 (password As String, salt As Byte(), iterations As Integer, hashAlgorithm As HashAlgorithmName, outputLength As Integer) As Byte()

參數

password
String

用來衍生金鑰的密碼。

salt
Byte[]

用來衍生金鑰的金鑰 Salt。

iterations
Int32

操作的重複次數。

hashAlgorithm
HashAlgorithmName

要用來衍生金鑰的雜湊演算法。

outputLength
Int32

要衍生的金鑰大小。

傳回

Byte[]

長度 outputLength 的位元組陣列,以虛擬隨機索引鍵位元組填入。

例外狀況

passwordsaltnull

outputLength 不是零或正值。

-或-

iterations 不是正值。

hashAlgorithmName具有空的 或 null

hashAlgorithm 是不支援的雜湊演算法。 支援的演算法為 SHA1SHA256SHA384SHA512

password 包含無法轉換成 UTF8 的文字。

備註

password將使用 UTF8 編碼轉換成位元組。 針對其他編碼方式,請使用適當的 Encoding 將密碼字串轉換為位元組,並使用 Pbkdf2(Byte[], Byte[], Int32, HashAlgorithmName, Int32)

適用於