Encryption at Rest?

Volume 4, Issue 44; 26 Oct 2020

Rolling my own security solution, in other words: doing it wrong.

I want to store some files on a simple Linux web server somewhere and I want to be able to serve those files up to authorized users. That’s not hard.

I’d like to have just a little bit more security. I’m not trying to thwart government agencies or serious professional hackers, but if the ISP screws up and someone gets access to the disk, I’d like peace of mind about the data being unreadable.

I would like to have the files encrypted on disk.

Then the question is, how do you serve them up? Big cloud providers have ways of providing this feature, and maybe the emphatic answer is “use one of them!”

Fair enough, but for various reasons that aren’t the subject of this post, that’s not the ideal solution.

It occurred to me that something like this might work:

Encryption at Rest

Basic authentication over SSL should be safe. That means the web server can get a nice big random string from the browser (the base64 encoded username and password). I’m happy to insist that the password be seriously long.

I could use that as a passphrase to encrypt a public/private key pair and I could use those keys for encrypting the actual data.

If someone steals the disk image, they get a bunch of encrypted data and the actual encryption keys aren’t in the code or on disk. (This is where a state level bad actor infiltrates the server and copies the keys out of memory. Nothing on this server is ever going to be that interesting, I promise.)

This is a trash solution and I should be ashamed of myself?

This is a solved problem and I should be using [insert name of thing here]?

Why don’t you use certificate based authentication? It works perfectly with web browsers today, even on mobile. Show me how.

Or, perhaps most unlikely, this isn’t an awful idea?