Skip to content

DeriveKeyFromPassphrase Method ​

Definition ​

  • Namespace: JASE.Interfaces
  • Assembly: JASE.dll

byte[] DeriveKeyFromPassphrase(string passphrase, byte[] salt, KeyDerivationAlgorithm? algorithm, int keySize, int? iterations = null, HashProvider? hashProvider = null) ​

csharp
byte[] DeriveKeyFromPassphrase(string passphrase, byte[] salt, KeyDerivationAlgorithm? algorithm, int keySize, int? iterations = null, HashProvider? hashProvider = null)

Performs secure key derivation using PBKDF2 with configurable algorithm, key size, iteration count, and hash provider.

Parameters ​

NameDescription
algorithmOptional. The key derivation algorithm to use. Currently only PBKDF2 is supported.
hashProviderOptional. The hash algorithm to use with PBKDF2. Defaults to the configured or fallback provider.
iterationsThe number of hash iterations. Defaults to 10,000.
keySizeThe desired key size in bytes. Must be between 16 and 64 bytes.
passphraseThe input passphrase to derive the key from. Must meet minimum length requirements.
saltThe salt to use for derivation.

Returns ​

The securely derived cryptographic key as a byte array.