Non-cryptographers should be scared of crypto libraries. I'm not happy with that state (not every company has a friendly local cryptographer! or even an unfriendly one!), but that's sadly the state of things.
A story about my friend @yonatanzunger messing up, then suggestions.🧵
Yonatan went off to work for @humuinc several years ago (though he's at @Twitter now) and, being a small startup at the time, there were unsurprisingly zero cryptographers.
So one day I get a message from him asking what crypto library he should use, to which I replied "WHY???"
The reason I replied with serious "oh no" in my heart was that people screw up using crypto libraries all the time. So I wanted to know what he wanted to do with said library.
And what he wanted to do was encrypt some data and put it in a cookie so users couldn't mess with it.
I realized today that I had never talked publicly about something really important about the design of access control systems: design their semantics to be reverse-indexable.
This is a much spicier take than it sounds like, but there's a good reason. 🧵 [1/]
Right now, access control systems are built so you can show up and say "I want access to object X", the system looks up the access control rules for object X, and then figures out whether you should have access. [2/]
With the exception of a few corner cases, the semantics of access-control system you build should be able to be turned upside down. For this you want a reverse index (which wikipedia calls an "inverted index").