Appearance
CreateWithArgon2id Method
Definition
- Namespace:
JASE.Crypto - Assembly:
JASE.Crypto.dll
AesGcmOptions CreateWithArgon2id(string passphrase, string salt, IArgon2Options argon2Options = null, byte[] associatedData = null, Encoding encoding = null, AesEnvelopeFormat? format = null)
csharp
AesGcmOptions CreateWithArgon2id(string passphrase, string salt, IArgon2Options argon2Options = null, byte[] associatedData = null, Encoding encoding = null, AesEnvelopeFormat? format = null)Creates an AesGcmOptions instance by deriving a 256-bit key from a passphrase using the memory-hard Argon2id KDF. This is an opt-in alternative to the library-default PBKDF2 path; the Argon2 cost parameters are embedded in the resulting self-describing JaseV1 envelope so decryption needs only the passphrase.
Parameters
| Name | Description |
|---|---|
argon2Options | Optional Argon2 cost parameters (memory, time, parallelism, variant). When , the library's recommended Argon2id baseline is used. |
associatedData | Optional associated data (AAD) authenticated but not encrypted. Must be for JWE formats. |
encoding | Text encoding used to interpret the passphrase/salt. If , DefaultEncoding is used. |
format | Optional envelope format. Defaults to the self-describing JaseV1, which is required to round-trip Argon2id (raw/JWE formats cannot carry the cost parameters). |
passphrase | The passphrase from which the AES key will be derived. |
salt | The salt used during key derivation. Should be unique per key. |
Returns
A configured AesGcmOptions instance using an Argon2id-derived key.