We want to re-use the keys for performance. Be sure to consider the effects of partitioning.
Caching should be applied on encryption sometimes, but decryption all the time via a lightweight TTL LRU cache.
I took a lazier approach with a collection of immutable HashMap based caches (which is fine for this use case), and I'll swap that for a more performant cache layer later.
We want to re-use the keys for performance. Be sure to consider the effects of partitioning. Caching should be applied on encryption sometimes, but decryption all the time via a lightweight TTL LRU cache.