1.1 KiB
1.1 KiB
KriCommon Crypto Contract
- Crypto APIs are under
com.kri.common.feature.crypto.*and do not use a central key database. - AES uses PBKDF2-HMAC-SHA256 key derivation with salt and defaults to AES-256-GCM; callers may supply a master key, salt, IV, AAD, and detached or appended GCM tag representation for legacy interoperability.
kri.crypto.aes.keysand per-call master keys are supported operational compromises. Never log them or commit real values.- Per-call key material takes precedence over configured keys, and encrypted values retain key ID and KDF metadata for decryption compatibility.
- AES-GCM always requires its authentication tag. Use
AES_256_CBC_PKCS5only for explicitly identified legacy data that has no tag, and do not treat CBC as authenticated encryption. DigestServicesupports SHA-256/SHA-512 plus legacy-only MD5/SHA-1.AdaptiveHashServiceuses BCrypt for short secrets; do not use MD5, SHA-1, or a fast digest for new password or secret storage.