|
|
|
|
|
by reza_n
2558 days ago
|
|
Yup, we added this feature to Varnish Cache a few years ago, random key encryption. It generates a random key at startup and encrypts all memory with it. Since this kind of memory is only resident for the lifetime of the process, it works. We stored the random key in the Linux kernel using the crypto API [0] just because its not safe storing any kind of keys in a memory space used for caching (Cloudbleed [1]). We then use the key to generate a per object HMAC, so each piece of data ends up with its own key, which further prevents something like Cloudbleed. Since we used kernel crypto, overhead was about 50%. If you stay completely in user space, its probably much lower. [0] https://www.kernel.org/doc/html/v4.17/crypto/userspace-if.ht... [1] https://en.wikipedia.org/wiki/Cloudbleed |
|