5 ms·
I wish security experts would spend more time writing libraries. "Never roll your own security" isn't helpful when all you have are scrypt, bcrypt, and pbkdf, a
by strken 8y ago
I wish security experts would spend more time writing libraries. "Never roll your own security" isn't helpful when all you have are scrypt, bcrypt, and pbkdf, and you have to implement a complete auth system by yesterday.
It is a lot more fun to poke holes than to be poked, though, so I understand it.
- tptacek 8y agoThey do! For instance, for the crypto problems David studies, security experts wrote Nacl, which brought cutting edge curve and AEAD crypto to developers with an almost user-proof interface.
- baby 8y agoI'm also working on that with www.discocrypto.com but admittedly my API is not there yet. Tink from Google is making good progress. Libsodium is often mentioned as having a good API. PS: it's not just frameworks. Languages like Rust and Go are doing huge things as well for developers.
- tptacek 8y agoAgree! Rust and Go both have really good nuts-and-bolts frameworks for crypto (I especially admire them for having misuse-resistant interfaces despite the need for standard libraries to support bad crypto protocols). Go's TLS is also, I think, a pretty major achievement.
- RandomInteger4 8y ago#NotAllSecurityExperts Only pointing that out, because apparently this was a big deal on Twitter a couple weeks back, where one group of experts were arguing that you weren't a real security expert without being able to code, and the other group arguing the contrary.
- tptacek 8y agoI don't know what "security expert" means, but I do believe that you can't secure software if you can't code, and I do believe most real-world security jobs require you to secure software.
- RandomInteger4 8y agoDon't tell me; tell the folks on Twitter. I was surprised as well. Quite a few of them took the "You don't need to code" side.
- michaelmrose 8y agoHow can you be a security expert insofar as the domain is software if you can't code?
- RandomInteger4 8y agoHonestly, I have no clue. That's a question for the security experts on Twitter.
- icedchai 8y agoThey can understand common patterns and find problems. That doesn't mean they can fix them.
- michaelmrose 8y agoYou can probably tell people how to physically secure their premises or not to put passwords on post it notes without knowing how to code but you can't help them write secure code if you can't you know code. This is like taking drivers ed from someone who can't drive. In theory you could reiterate material you had read on the matter and some material may even be of value but only a fool would learn to drive from someone who can't. The fact that not everyone is willing or able to see the emperor is a nudist doesn't mean his threads are real.
- 8y ago
- bryanrasmussen 8y agoI'm not familiar with it, but is an almost user-proof interface the same as having dialed the accessibility down to zero? or does it mean really good and the user can hardly make a mistake?
- SilasX 8y agoEh, my experience with crypto libraries is that they're poorly written from a user perspective (regardless of if they do it right under the hood). The hardest parts of the Matasano security challenge are those that require me to get some off-the-shelf crypto library to perform as expected. For example, Rust's main AES implementation requires you to delve into details you shouldn't care about in order to get it to work. It doesn't let you just pass in Vec<u8> bytes and get Vec<u8> back out. It doesn't even let you put it through a converter functions to match the library's internal representation. No, you have to learn low level details of how to instantiate a special fixed-size mutable buffer type and then figure out how to manage that and maintain proper ownership when extracting.
- tptacek 8y agoI can't speak to Rust's library, but Go's NewGCM/AEAD.Seal is about as good an interface as I think you could reasonably ask for.
- SilasX 8y agoOh, nice, that's what I wish Rust had, which makes you navigate through this: https://docs.rs/rust-crypto/0.2.36/x86_64-apple-darwin/crypto/aes/index.html https://docs.rs/rust-crypto/0.2.36/x86_64-apple-darwin/crypt...
- steveklabnik 8y agoIsn’t rust-crypto abandoned? I didn’t think it was the best practice here. EDIT: yep, not touched since 2016. I'm not a crypto expert, but I asked someone who is and he pointed me to https://docs.rs/miscreant/0.4.2/miscreant/aead/trait.Aead.html https://docs.rs/miscreant/0.4.2/miscreant/aead/trait.Aead.ht...
- SilasX 8y agoHm, rust-crypto was what came up with when I searched -- don't remember why I chose that vs the others. (And it's not 2016 that was the wild-west days of poor Rust design and unnecessary mutable params.) Miscreant looks like its has just as bad an interface as the one I used. You have to do a lot of work -- and deal with unnecessary low-level details of mutable fixed-length buffers -- to implement the thing you really want, which is a function that takes a byte stream of any length, a key and returns you another byte stream.
- spydum 8y agoi mean, pretty sure you mean "Never roll your own crypto".. most people should be writing some bit of "security".. You probably want authentication, authorization, audit and so on in your app. Now, I do think I agree in the spirit of what you mean: frameworks and libraries should make this stuff easy.. I think for the most part, they do, for example: django has authentication; ruby has gems like Devise; python has stuff like flask-security.. So they exist, there are solutions, it's just not always well known by developers. So they do what they have been trained to: just write their own (faster to reason about my own code than consuming another dependency with all it's archaic config!).
- strken 8y agoYeah, I was taking a bit of license with the term. The problem is that rolling your own non-crypto security is still fraught with danger, and not all languages provide good libraries that hide the dangerous choices for you. Even worse, those libraries often aren't written or audited by security experts either, which is a bigger problem.