Home/aeat package/aeat.adapters package/aeat.adapters.persistence package/aeat.adapters.persistence.storage package/aeat.adapters.persistence.storage.master_key package/aeat.adapters.persistence.storage.master_key._master_key_derivation module aeat.adapters.persistence.storage.master_key._master_key_derivation module¶ Argon2id derivation constants and helpers for file-backed master keys. ARGON2_MEMORY_COST_KIB: Final[int]¶ Argon2id memory_cost in KiB (19 MiB — OWASP-current top tier). ARGON2_TIME_COST: Final[int]¶ Argon2id time_cost (number of iterations) — OWASP-current top tier. ARGON2_PARALLELISM: Final[int]¶ Argon2id parallelism — OWASP-current top tier. SALT_SIZE: Final[int]¶ Per-store salt size in bytes. KDF_PARAMS_VERSION: Final[int]¶ On-disk KDF parameter shape accepted by the file-backed provider. derive_kek(passphrase, salt)[source]¶ Derive a 32-byte KEK from the operator’s passphrase and per-store salt. Return type: bytes Parameters: passphrase (bytes) salt (bytes) derive_kek_with_params(passphrase, salt, *, memory_cost, time_cost, parallelism)[source]¶ Derive a 32-byte KEK with explicit persisted Argon2id parameters. Return type: bytes Parameters: passphrase (bytes) salt (bytes) memory_cost (int) time_cost (int) parallelism (int)