Appearance
DeriveKey Method
Definition
- Namespace:
JASE.Interfaces - Assembly:
JASE.dll
byte[] DeriveKey(string passphrase, byte[] salt, KeyDerivationAlgorithm? algorithm = null, int length = null, int? iterations = null, HashProvider? hashProvider = null)
csharp
byte[] DeriveKey(string passphrase, byte[] salt, KeyDerivationAlgorithm? algorithm = null, int length = null, int? iterations = null, HashProvider? hashProvider = null)Derives a cryptographic key from a passphrase and salt using the configured or specified key derivation algorithm.
Parameters
| Name | Description |
|---|---|
algorithm | Optional. The key derivation algorithm to use. If null, the default configured algorithm is used. |
hashProvider | Optional. Specifies the underlying hash algorithm to use (e.g., SHA256, SHA512). Defaults to the configured or core default provider. |
iterations | The number of hash iterations to perform. Defaults to 10,000. |
length | The desired length of the derived key in bytes. Must be between 16 and 64 bytes. |
passphrase | The passphrase to use for key derivation. Must meet the minimum length requirement. |
salt | The cryptographic salt. |
Returns
The derived key as a byte array.