Rolling your own crypto: Everything you need to build AES from scratch
41–50 of 92 posts
Re: Rolling your own crypto: Everything you need to build AES from scratch
#42Earlier quoted context omitted.
Isn't table lookup constant time?
These are called "cache-timing attacks". In presence of caches, no memory lookup can be guaranteed to be constant time. Any memory lookups that use secret indices are thus not timing-safe, however non-secret indices are OK. See https://cr.yp.to/antiforgery/cachetiming-20050414.pdf Here's an implementation that doesn't use tables: https://github.com/openbsd/src/blob/master/sys/crypto/aes.c
Re: Rolling your own crypto: Everything you need to build AES from scratch
#43Earlier quoted context omitted.
Just no. This idea that people are not allowed to learn by doing things and must read huge books first is absurd. The guidelines for learning you gave here are impractical for majority of people who are interested. It is actually good when people are trying to learn about security. Just about worst thing these absurd rules achieve is that effectively only rule breakers are allowed in.
> Just no. This idea that people are not allowed to learn by doing things and must read huge books first is absurd. No, its not absurd. Sure, I agree, for many things in life you can "learn by doing". But this is cryptography. There is no escaping that cryptography IS mathematics and an algorithm built on top of that mathematics. Unfortunately the only way to learn the theory is by reading and understanding books or…
Re: Rolling your own crypto: Everything you need to build AES from scratch
#44Earlier quoted context omitted.
You mostly learn cryptography by doing cryptanalysis, and that certainly is a form of playing with ciphers. To be fair, modern cryptanalysis also involves a bit of math and reading some papers. None of this is something that hobby cryptographers can't do. In fact, there is no real difference between "professional" and hobby cryptographers. Many of the professional ones started as hobby cryptographers, and there are p…
The "don't roll your own crypto" is a mantra mostly useful for deciding what to put into production, not as a general ban on even touching the stuff before you become some kind of mythical, long-bearded, tome-possessing wizard. I thought this was pretty obvious but I guess this important context was not sufficiently disseminated given the prevalence of the latter position.
Re: Rolling your own crypto: Everything you need to build AES from scratch
#45Re: Rolling your own crypto: Everything you need to build AES from scratch
#46Earlier quoted context omitted.
It’s absolutely worth it to roll your own crypto if you want to learn from it. I feel like there is almost a stigma against articles like these because we’ve all been conditioned so much to avoid even thinking about it lol. I did some deep dive into AES and RSA at some point in a distant past, it was a learning experience that to this day allows me to make much better decisions when choosing algorithms.
> It’s absolutely worth it to roll your own crypto if you want to learn from it No. If you want to "learn from it", the first thing you should do is buy a copy of Bruce Schneier's Applied Cryptography . Just reading (and fully understanding !) that book will alone put you in a position where you already know more about cryptography than 90% of other people. If after that you still want to play around with rolling you…
Re: Rolling your own crypto: Everything you need to build AES from scratch
#47Refreshing to see "crypto" meaning cryptography, not cryptocurrencies... And also good that they mention right from the start that you shouldn't use your (or their) self-made cryptography in production (although they could have emphasized it a bit more).
> you shouldn't use your (or their) self-made cryptography in production Absolutely, and that was the very first thing I thought when I saw the title. For some reason I've got the "don't roll your own crypto" commandment heavily ingrained into my brain (even though I've never been in any context where I might have tried), together with "don't let the frying pan handle stick out over the edge of the cooker in case a k…
May be true, but not exactly a great message.
Re: Rolling your own crypto: Everything you need to build AES from scratch
#48Earlier quoted context omitted.
Just no. This idea that people are not allowed to learn by doing things and must read huge books first is absurd. The guidelines for learning you gave here are impractical for majority of people who are interested. It is actually good when people are trying to learn about security. Just about worst thing these absurd rules achieve is that effectively only rule breakers are allowed in.
> Just no. This idea that people are not allowed to learn by doing things and must read huge books first is absurd. No, its not absurd. Sure, I agree, for many things in life you can "learn by doing". But this is cryptography. There is no escaping that cryptography IS mathematics and an algorithm built on top of that mathematics. Unfortunately the only way to learn the theory is by reading and understanding books or…
Re: Rolling your own crypto: Everything you need to build AES from scratch
#49Refreshing to see "crypto" meaning cryptography, not cryptocurrencies... And also good that they mention right from the start that you shouldn't use your (or their) self-made cryptography in production (although they could have emphasized it a bit more).
> you shouldn't use your (or their) self-made cryptography in production Absolutely, and that was the very first thing I thought when I saw the title. For some reason I've got the "don't roll your own crypto" commandment heavily ingrained into my brain (even though I've never been in any context where I might have tried), together with "don't let the frying pan handle stick out over the edge of the cooker in case a k…
Re: Rolling your own crypto: Everything you need to build AES from scratch
#50Earlier quoted context omitted.
> you shouldn't use your (or their) self-made cryptography in production Absolutely, and that was the very first thing I thought when I saw the title. For some reason I've got the "don't roll your own crypto" commandment heavily ingrained into my brain (even though I've never been in any context where I might have tried), together with "don't let the frying pan handle stick out over the edge of the cooker in case a k…
How does crypto even get created, then? Like, those cryptography experts — they do roll their own crypto, and then it gets standardized as Blowfish/AES/Salsa20/etc. How did they learn to make ciphers that are "good enough" to use in production? Are those people special somehow, and it's not possible to become one of them?
The standards are either the outcome of competitions the US government (through NIST) has held over the years, or they're de-facto standards because they're provably better for certain use cases than other algorithms.