Since then, I haven't shed the habit of designing for the general case (this is also known as avoiding vendor lock-in :)
13 karma · joined December 8, 2017
Since then, I haven't shed the habit of designing for the general case (this is also known as avoiding vendor lock-in :)
More seriously, because LAMP stacks are ubiquitous, well understood and well supported by vendors. Also, the output of this code is trivial to use or replicate in most other languages - in fact, I've got some fragments of C source lying around for a similar system, that was intended for a command-line tool that would interoperate with a distant ancestor of Lockbox.
That concern for future interop possibilities is the main reason it stores secrets in JSON - which is one reason, along with abysmal character encoding practices by many developers, that the key and ciphertext is all ASCII-safe. A 30% bump in output size is more than offset by never having to care what transport those strings are moving through.
Re: libsodium, there will be optional support for it at some point precisely because it's going into the core, but I try to do all my components like this with no required dependencies. I'm not even entirely satisfied with Lockbox requiring the openssl extension, but that's far preferable to yet another homespun AES implementation.
I've also used similar code to manage an encrypted file store for a small business - since each file gets its own locks (essentially a cryptographic ACL) and each attached key is publicly identified, it's easy to see who can read (or change) any given file. Being able to remove lockboxes without decrypting the data means that a sysadmin can strip access from someone who leaves the company without needing an all-powerful "root" key.