News for hackers. Stuff that matters.
Re:Rolling your own crypto: Everything you need to build AES... by stingraycharles on Wednesday July 13, 2022 @04:46AM (#32080309)
That’s super personal. I am the type of person who learns by doing, much less reading, and I reject not being “allowed” to do it this way. I will of course study the reading material as I go, but “doing while learning” is an absolute necessity for me, as is studying existing codebases. You learn your way, I learn my way, but don’t tell me my way is wrong just because it’s crypto.

I honestly think, as a community, we’re being far too dogmatic about our advice here, and we should recognise that there is value in learning things by example, and that more people having a better understanding of crypto is generally a Good Thing.

Using it in production, of course, is an entirely different matter, but that’s not what I’m contesting.

Re:Rolling your own crypto: Everything you need to build AES... by Beldin on Wednesday July 13, 2022 @06:31AM (#32080855)
> don’t tell me my way is wrong just because it’s crypto.

The way where people think they learn cryptography by making their own implementation is, indeed, wrong. Cryptography is about ensuring specific requirements in the face of active adversaries.

Self-implemented crypto misses many well-known caveats, causing them to be easily breakable. As such, it is not reasonable to consider them as something that aims learn about ensuring security properties in the face of active adversaries... but then that effort is not actually teaching about crypto, which is exactly that.

This is also the reason that the established wisdom for learning cryptography is to learn to break systems first. Almost everyone can make a cryptographic system they cannot break. For most folks, that means little. For those skilled at breaking crypto, that carries weight.

Re:Rolling your own crypto: Everything you need to build AES... by stingraycharles on Wednesday July 13, 2022 @06:57AM (#32081018)
But you're approaching it from the wrong perspective: the idea isn't to use the crypto you implement yourself, the idea is to gain a better understanding of how the "magic" works. Of course my hand-rolled RSA/AES crypto is breakable, I know that because that's the default assumption.

It's akin to saying, "you're not allowed to build your own smoke detector because it will be unsafe!". Of course I know that, I want to understand the differences between a photoelectric and ionization smoke detector, how they work in practice, because reading some PDF schematics just doesn't cut it for me.

I honestly don't understand the line of reasoning of all this crypto gatekeeping.

Fun fact: while I was doing my crypto deep dive in 2015, my language of choice being Haskell, I found issues in several libraries, specifically around entropy, and even one library with modulo bias [1]. They were acknowledged and addressed. It was a super fun learning exercise, and seeing all these comments how it's supposedly almost illegal to do this misses the point of people exploring and learning in their own ways.

https://github.com/vincenthz/hs-crypto-numbers/commit/bceb54...

Re:Rolling your own crypto: Everything you need to build AES... by ziddoap on Wednesday July 13, 2022 @09:57AM (#32082789)
>I found issues in several libraries, specifically around entropy, and even one library with modulo bias

This is exactly what the other people in this thread mean when they say "learn by breaking other crypto", assuming you didn't write those libraries.

Re:Rolling your own crypto: Everything you need to build AES... by stingraycharles on Wednesday July 13, 2022 @03:28PM (#32087667)
One of the reasons I want to learn how these things work in detail is that I want to understand the whole stack I’m working with, from top to bottom. As part of my quest to implement an asymmetrical encryption algo, I ended up wondering “how do I create truly random entropy?”, and went down that rabbit hole.

It’s all about intent: my intent is understanding “how does this work?”, “how do I do this the right way?”, not breaking, and that’s how I found these things.

I don’t care about breaking stuff, it’s just not appealing to me. My whole frustration with this discussion is that for some reason, my intentions are not the True Way of the Crypto Experts, and then I’m not allowed to proceed.

It’s such utter nonsense, and this whole discussion made me realise the situation is actually worse than I thought. If these commenters here are representative of the wider crypto community, they’re really a bunch of elitist gatekeepers that cannot understand the difference between being the NSA and a mere mortal trying to learn things in their own way.

Re:Rolling your own crypto: Everything you need to build AES... by recursiveturtle on Wednesday July 13, 2022 @07:03AM (#32081049)
Hear that? Learn from breaking crypto ... just not your own.

On a related note, Beldin here just contributed a new entry into cryptopals: the Gatekeeper hash, but only certain people can see the link.