Documentation Index
Fetch the complete documentation index at: https://mintlify.com/himansaBro/JungleConfig/llms.txt
Use this file to discover all available pages before exploring further.
EncryptedConfig wraps the standard JConfig001 format in AES-256/GCM encryption. The password you supply is processed with PBKDF2WithHmacSHA256 (100,000 iterations, 256-bit output) to derive a strong encryption key, meaning the file stored on disk is pure ciphertext — completely unreadable without the correct password. The read and write APIs are identical to every other JungleConfig mode, so switching to encrypted storage requires only a one-line change at construction time.
Creating an encrypted config
Pass aFile and a password string to JungleConfig.EncryptedConfig. From that point on, every write automatically encrypts the data before touching the filesystem.
Reading back encrypted values
Open the config file with the same password and callget or Get exactly as you would in plain-file mode. Decryption is handled transparently inside NativeEncryptedConverter before the data reaches your application code.
Encryption details
The following parameters are hardcoded inNativeEncryptedConverter and cannot be changed without a custom converter:
- Algorithm: AES-256/GCM/NoPadding
- Key derivation: PBKDF2WithHmacSHA256, 100,000 iterations, 256-bit output key
- Salt: 16 bytes, generated fresh on every write using
SecureRandom - IV (Initialization Vector): 12 bytes (96 bits, the GCM-recommended size), generated fresh on every write using
SecureRandom - On-disk layout:
Base64( salt[16 bytes] + IV[12 bytes] + ciphertext )
javax.crypto.Cipher automatically and is included inside the ciphertext portion of the layout above.
When to use encrypted config
UseEncryptedConfig whenever the configuration file contains data that must not be readable at rest:
- Database credentials (usernames, passwords, connection strings)
- Third-party API keys and tokens
- Signing secrets or private key material
- Configuration files that ship alongside a deployed binary and could be read by anyone with filesystem access
JungleConfig(File) constructor is simpler and avoids the decryption overhead on every read.
