KeyDerivationConfig

data class KeyDerivationConfig(val algorithm: String = "PBKDF2WithHmacSHA256", val iterationCount: Int, val saltLengthBytes: Int = 32, val keyLengthBits: Int = 256)

Configuration for password-based key derivation.

These parameters control the PBKDF2 (or similar) key derivation used for deriving cryptographic keys from passwords or passphrases.

The default values follow OWASP 2023 recommendations for PBKDF2-HMAC-SHA256.

Constructors

Link copied to clipboard
constructor(algorithm: String = "PBKDF2WithHmacSHA256", iterationCount: Int, saltLengthBytes: Int = 32, keyLengthBits: Int = 256)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The key derivation algorithm. Supported values: - "PBKDF2WithHmacSHA256" (recommended, default) - "PBKDF2WithHmacSHA512" - "PBKDF2WithHmacSHA1" (legacy, not recommended)

Link copied to clipboard

Number of iterations for the derivation function. Higher values increase security but also computation time. OWASP 2023 recommends 310,000 for SHA-256.

Link copied to clipboard

Length of the derived key in bits. 256 bits is standard for AES-256.

Link copied to clipboard

Length of the random salt in bytes. NIST recommends at least 16 bytes; we default to 32.