SafeBox 1.1.0 introduces a new era of concurrent cryptography, memory-safe encryption, and lifecycle precision for Android's most secure key-value store. This release is the culmination of the 1.1.0 series, bringing together weeks of hardening, concurrency research, and community feedback.
Security Improvements
-
XOR-based key masking
The in-memory DEK is now XOR-masked with a SHA-256 hash, reconstructed only when needed, and zeroed out immediately. (#23) -
On-demand AES-GCM ciphers
AesGcmCipherProvider
now creates ciphers per use, reducing persistent memory risks. (#28)
Cryptographic Concurrency
-
CipherPool
A thread-safe, coroutine-friendlyCipher
pool for safe reuse in high-concurrency environments. Built with a load-factor strategy and background scaling. (#25) -
SafeBoxExecutor
An internal executor powering CipherPool scaling and future crypto tasks. Reusable for advanced use cases. (#25) -
Thread-safe Key Access
SafeSecretKey
andSecureRandomKeyProvider
are now concurrency-aware via atomic key caching and minimal locking. (#26)
Lifecycle Precision
-
SafeBoxStateManager
Centralized lifecycle controller trackingSTARTING
,WRITING
,IDLE
, andCLOSED
. Ensures valid state transitions across async or nested writes. (#17) -
Global Observability
New APIs likeSafeBoxGlobalStateObserver
andSafeBoxStateListener
allow global and per-instance tracking of SafeBox states. (#12)
Compatibility & Maintainability
-
compileSdk bumped to 36
Future-proofs SafeBox against the latest Android SDK changes. (#2) -
Safer BouncyCastle injection
Now performed lazily and only when ChaCha20 is missing. Prevents overwriting host app crypto configs. (#1)
Benchmark Update
See the new performance benchmarks comparing v1.1.0
against EncryptedSharedPreferences
.
Highlights include:
- 100x faster initialization
- 2x faster write throughput
- Better concurrency under heavy commit loads
Gradle Setup
implementation("io.github.harrytmthy-dev:safebox:1.1.0")
Crafted with care by Harry Timothy Tumalewa
If SafeBox made your app more secure or saved you time, please consider ⭐ starring the repo or sponsoring on GitHub!