News for hackers. Stuff that matters.
Re:Rolling Your Own Crypto by rahrahrah on Tuesday December 20, 2016 @12:47PM (#13222097)
> Erratum: Apparently, I don't know what I'm doing either. I committed a number of approximations, misdirections, and even errors in there. Some of them where pointed out by /u/sacundim on Reddit. If you thought you could trust me, read that comment. It's sobering.

LOL brilliant. That was fast.

Re:Rolling Your Own Crypto by oconnore on Tuesday December 20, 2016 @01:09PM (#13222322)
A lot of those criticisms are sort of unfair. For example, pointing out length extension attacks in a fabricated MAC construction not found in the article, especially when the OP explicitly recommends blake2b, which is not vulnerable to length extension (and also disclaims "How that magical MAC is built is beyond the scope of this paragraph.").

Another example: criticizing that he mentions appending a MAC (you should choose an AEAD!)... when later he recommends using an AEAD.

Re:Rolling Your Own Crypto by dom0 on Tuesday December 20, 2016 @01:28PM (#13222503)
AEAD normally only means actual AEAD constructions (think AES-GCM/OCB, Chacha20-Poly1305 - not combinations of primitives providing authentication (=EtM, eg. first encrypt with AES-CTR then MAC with some HMAC).

But yeah, some of the criticism reads kinda nit-picky / "I'm going to find false things in here". But on the other hand he provides good hints how the article could be improved.

Re:Rolling Your Own Crypto by oconnore on Tuesday December 20, 2016 @01:29PM (#13222514)
The article recommends Chacha20 Poly1305, not some combination of primitives.
Re:Rolling Your Own Crypto by dom0 on Tuesday December 20, 2016 @01:31PM (#13222529)
What do you mean by this then?

> Another example: criticizing that he mentions appending a MAC (you should choose an AEAD!)... when later he recommends using an AEAD.

Re:Rolling Your Own Crypto by oconnore on Tuesday December 20, 2016 @01:40PM (#13222606)
There is a section called "integrity: not optional", where he uses MACs (which I would consider to be conceptually simpler to understand than AEADs) to explain how integrity can be implemented.

Later, in a section called "Level 2: choosing crypto", he recommends using ChaCha20 Poly1305.

Anyway, this isn't really my crusade, I just think that if you read the informal blog post as an informal blog post, it's fine.

Re:Rolling Your Own Crypto by lvh on Tuesday December 20, 2016 @02:16PM (#13222951)
I think the criticism is still valid: combining a MAC and cipher into an AE scheme (especially an AEAD scheme) is anything but trivial. For example, I don't think it's reasonable to suggest someone would, given those two tools, end up with the moral equivalent of secretbox but with ChaCha20 replacing XSalsa20. (At least there's not a padding timing differential for MtE, but still.)
Re:Rolling Your Own Crypto by loup-vaillant on Thursday December 22, 2016 @07:31AM (#13236800)
> A lot of those criticisms are sort of unfair.

Possible, but my readers aren't fair either. If I phrase stuff the wrong way, someone might go off and do something stupid.

In a similar vein, one that stops reading at level 1 will miss my AEAD recommendation at level 2. Were they asking for it, or should I have put the recommendation earlier? Tough call.

Re:Rolling Your Own Crypto by mfukar on Tuesday December 20, 2016 @01:35PM (#13222567)
There is no fairness in cryptography, only math.
Re:Rolling Your Own Crypto by neaden on Tuesday December 20, 2016 @12:58PM (#13222203)
I'm glad he put that up at the top instead of trying to hide it. The moral of the story appears to be indeed: Don't roll your own crypto.
Re:Rolling Your Own Crypto by inetsee on Tuesday December 20, 2016 @01:04PM (#13222269)
I think rolling your own crypto, as a learning exercise, can be very helpful when choosing which trusted crypto solutions to use for a particular use case.
Re:Rolling Your Own Crypto by lvh on Tuesday December 20, 2016 @02:19PM (#13222974)
Breaking crypto is certainly an excellent way to learn many kinds of crypto. The problem is that writing your own typically isn't enough by itself -- a lot of horribly broken crypto looks fine after casual inspection. You probably won't find bugs like CBC padding oracles or Bleichenbacher attacks all by yourself. You can, however, absolutely _implement_ them yourself. I recommend cryptopals, together with my own free book, Crypto 101 if you prefer a little prose versus trying to figure it out yourself.
Re:Rolling Your Own Crypto by loup-vaillant on Thursday December 22, 2016 @07:37AM (#13236841)
I draw a different conclusion: don't roll crypto on your own. https://www.reddit.com/r/programming/comments/5iv1ti/rolling...

I have updated my article since, and also made clear you can still screw up even if you had help.

Re:Rolling Your Own Crypto by grkvlt on Tuesday December 20, 2016 @01:54PM (#13222759)
> Erratum: [...] Some of them where pointed out [...]

And Muphry's Law[0] strikes again!

[0] https://en.wikipedia.org/wiki/Muphry's_law

Re:Rolling Your Own Crypto by Bartweiss on Tuesday December 20, 2016 @01:51PM (#13222725)
If nothing else, this was a hell of a lesson in just how hard rolling your own crypto really is.