News for hackers. Stuff that matters.
Re:Hell Is Overconfident Developers Writing Encryption Code by smolder on Saturday February 01, 2025 @01:25AM (#42896186)
I honestly think it's a meme born of propaganda. 'Don't roll your own' is good advice a lot of the time when there are hardened libraries at your disposal, but who does it serve if less people know how to build useful cryptography? Three letter agencies mostly. I had no trouble implementing useful algorithms in college as part of my study of it, or understanding different potential weaknesses like timing or known plaintext attacks. We didn't cover side channels like power analysis but how often does that actually matter outside of a lab?
Re:Hell Is Overconfident Developers Writing Encryption Code by tptacek on Saturday February 01, 2025 @02:01AM (#42896388)
The fact that you're referring to useful algorithms here is kind of a "tell", for what it's worth. "Known plaintext attacks" are not a broad class of vulnerability in cryptosystems; they're a setting for attacks. It's like saying "I've studied the browser security model including weaknesses such as the same origin policy".
Re:Hell Is Overconfident Developers Writing Encryption Code by smolder on Tuesday February 04, 2025 @11:29PM (#42943813)
What do you think an algorithm is? This weird criticism is kind of a "tell", for what it's worth. Ciphers are algorithms. This is unnecessarily combative. I'm disappointed by your posts in this thread, because they're low on substance an high on posturing.
Re:Hell Is Overconfident Developers Writing Encryption Code by scott_w on Saturday February 01, 2025 @02:06AM (#42896421)
Learning crypto isn’t just a box ticking exercise that you learn it and now you’re qualified to “do crypto” for the rest of your career. I also studied this in university but I know that I don’t spend anywhere near enough time to day to avoid, well, any pitfalls of rolling my own crypto.

I currently work on our company’s Auth systems and half my team still side-eyes our own work, despite having worked on this area for years now.

Re:Hell Is Overconfident Developers Writing Encryption Code by smolder on Saturday February 01, 2025 @02:15AM (#42896481)
All I'm reading here is more of the same scare-mongering. I don't casually implement cryptosystems to be used in critical situations, and I wouldn't attempt it without a serious amount of research. But "never do it yourself" is a poor substitute for actually spreading knowledge about how to do it and open discussion of pitfalls. It rubs me the wrong way.
Re:Hell Is Overconfident Developers Writing Encryption Code by scott_w on Saturday February 01, 2025 @03:56AM (#42896964)
You do understand “never do it yourself” implicitly applies to a commercial/production context, right? Nobody is stopping you learning or choosing to enter the field (to make it your sole professional focus).
Re:Hell Is Overconfident Developers Writing Encryption Code by Asraelite on Sunday February 02, 2025 @03:15AM (#42907066)
It certainly comes across like people are discouraging others from even learning about it.

Just read through this thread and see how few people are saying anything like "you should still learn how cryptographic primitives work though". It's almost nothing but negativity and discouragement.

Re:Hell Is Overconfident Developers Writing Encryption Code by some_furry on Sunday February 02, 2025 @03:29AM (#42907130)
The blog post in question (which I wrote) literally opens with a link to https://www.cryptofails.com/post/75204435608/write-crypto-co... that encourages people to learn about it! Yes, even if that type of learning means (privately) writing crypto code.

Why would you expect the comments about it to argue in favor of "still learning" when the blog post never advocated against learning? They aren't making this point because I didn't make the contrary one, so there's nothing to argue with.

That you're only seeing negativity and discouragement is a cognitive distortion. I'm not qualified to help people with those, but I hope pointing that out might help you see that the world isn't against you.

That software developers presently and generally are bad at understanding cryptography doesn't mean it's impossible to learn, or that you should be discouraged from learning.

Re:Hell Is Overconfident Developers Writing Encryption Code by Asraelite on Sunday February 02, 2025 @03:54AM (#42907277)
Alright that's fair, in this thread there's not much reason for people to encourage learning it so it wasn't a good example to use. Thank you for helping people to learn more about it.

That being said, the sentiment around rolling your own crypto that I see in the rest of internet in general still strongly discourages any kind of curiosity, intentionally or not.

In other places where it's discussed and in the comments on this thread which are not a direct response to aspects of the blog, you get mostly the same kind of response.

Re:Hell Is Overconfident Developers Writing Encryption Code by scott_w on Sunday February 02, 2025 @07:29AM (#42908236)
> Just read through this thread and see how few people are saying anything like "you should still learn how cryptographic primitives work though". It's almost nothing but negativity and discouragement.

That’s what the “implied” part of my comment means.

Re:Hell Is Overconfident Developers Writing Encryption Code by xvector on Saturday February 01, 2025 @01:51AM (#42896339)
No, you can not competently roll your own crypto because you took an algorithms class in college. Even the assumption you could is absurd.
Re:Hell Is Overconfident Developers Writing Encryption Code by smolder on Saturday February 01, 2025 @01:55AM (#42896357)
It wasn't 'an algorithms class' but grad level cryptography. We did implement boxes as a project and were graded on them. Where do you think people learn this stuff? Super secret cryptography school? I even used it. I previously built a secondary layer protocol using diffie hellman that runs on top of TLS such that in the event TLS is broken there's still some level of secrecy, and I'm very confident that it's better than nothing. Defense in depth, you know?
Re:Hell Is Overconfident Developers Writing Encryption Code by xvector on Saturday February 01, 2025 @01:58AM (#42896375)
Yes, most of us have likely taken a grad level cryptography course. Still, that's not enough to securely roll your own crypto.

You want many years of experience and a community of experts working with you. If you don't have that - 99.9999% of devs do not - just use libsodium.

Re:Hell Is Overconfident Developers Writing Encryption Code by smolder on Saturday February 01, 2025 @02:06AM (#42896423)
The arrogance and elitism is wild. I never said people shouldn't use libsodium.
Re:Hell Is Overconfident Developers Writing Encryption Code by tptacek on Saturday February 01, 2025 @02:16AM (#42896485)
No, instead you said you learned about how to understand "known plaintext attacks", counting on the average reader of this thread not to know that's a content-free claim. One time, in a "graduate level" cryptography class, you even built a protocol using Diffie-Hellman on top of TLS. OK!
Re:Hell Is Overconfident Developers Writing Encryption Code by smolder on Saturday February 01, 2025 @02:22AM (#42896520)
That project wasn't for school.
Re:Hell Is Overconfident Developers Writing Encryption Code by tptacek on Saturday February 01, 2025 @02:24AM (#42896531)
You provided it as a proof-point of some sort, but I've led lab exercises of freshmen CS students doing the same exercise, so I'm unclear what it's proof of.
Re:Hell Is Overconfident Developers Writing Encryption Code by smolder on Saturday February 01, 2025 @02:54AM (#42896685)
Proof that you don't need to be super-human to build something useful, also demonstrated by your freshman CS student anecdote.
Re:Hell Is Overconfident Developers Writing Encryption Code by tptacek on Saturday February 01, 2025 @03:10AM (#42896751)
Anybody can build a Diffie-Hellman protocol. You can practically do with a calculator; in fact, we did that as an exercise at a talk, with a big audience, using frisbees to "exchange" the keys. But: the talk was about how, as a pentester, to trivially break these systems, because making a system that uses a DH key exchange safely, as opposed to one that simply appears correct in unit tests, is treacherously hard.

I'm still curious about what you could have possibly meant by learning about "weaknesses" like "known-plaintext attacks". Can you say more?

Re:Hell Is Overconfident Developers Writing Encryption Code by smolder on Saturday February 01, 2025 @11:51AM (#42899753)
It's been years, but I recall that, for example, when you know every piece of plaintext starts with "https://www", or perhaps know the full contents of particular messages, it may become some degree easier to brute force your way to a key. I don't think it's a concern for standards in broad use, more like something you would worry about if you were cooking up your own cipher.
Re:Hell Is Overconfident Developers Writing Encryption Code by xvector on Saturday February 01, 2025 @02:18AM (#42896499)
It isn't arrogant or elitist to suggest that no one person should be rolling their own crypto, even if they have taken a grad level cryptography class.

For instance, you don't expect an aviation engineer to build a brand new plane on their own. They would be missing decades of cumulative knowledge, battle testing, perspectives and knowledge outside of their own. These systems are complex, to the point where taking a grad course is not enough.

I have worked with actual experts on cryptography throughout my big tech career - people that have actually written parts of common crypto libraries suggested in this thread - and even they themselves are not interested in writing crypto code. It is an incredibly involved group effort between experienced experts and your first iteration will almost certainly be broken. There is almost never a reason to do this.

If you are so confident in your ability to do so, you may simply be a crypto prodigy, and I apologize. You should post your DHE implementation here. If it's secure and useful, there shouldn't be an issue, and surely the community would benefit from it.

Re:Hell Is Overconfident Developers Writing Encryption Code by smolder on Saturday February 01, 2025 @02:29AM (#42896558)
Again you're mistaking my point. I know enough to know what I don't know and the risk involved in doing any serious crypto work, that I can't solo build libraries to protect financial transactions or whatever willy-nilly. It's obviously a ton of work to get right.

What I'd advocate for instead of "never roll your own crypto" is more like "never use your own crypto in prod". People are better off knowing more than less and getting their hands a little dirty. I think the former, common message is more like "don't even try to understand it," which is a joke.

Re:Hell Is Overconfident Developers Writing Encryption Code by xvector on Saturday February 01, 2025 @03:49AM (#42896926)
The "in prod" is implicit, no one is trying to stop you from learning things.
Re:Hell Is Overconfident Developers Writing Encryption Code by izacus on Sunday February 02, 2025 @07:48AM (#42908306)
It makes more sense if you understand that gatekeeping like this also provides job security for security consultants telling you to buy their services instead.