News for hackers. Stuff that matters.
Re:The Cryptographic Doom Principle by jxcl on Tuesday April 14, 2015 @12:03PM (#9375212)
That makes sense intuitively, but you can't approach cryptography intuitively. There are many cases where the intuitive answer is "well, the worst case is that it's just as good as without our custom wrapper... so let's do it." But under cryptographic analysis it is revealed that the custom wrapper renders whatever other good, accepted cryptography that is in play completely useless.
Re:The Cryptographic Doom Principle by dustyleary on Tuesday April 14, 2015 @12:16PM (#9375310)
I need to see a citation for this. Something like the parent article exposing how things get mistakenly broken by applying this concept.

It's important to be paranoid about implementing your own crypto, true. But it's not good to take this to dogmatic extremes, ie "never trust any code you write that has crypto in the name or you break everything".

I would never write and deploy a custom cypher. But if I did, and my custom cipher CC, when applied to ciphertext encrypted by AES, somehow leaked any information about the plaintext, then I have accidentally made a cryptanalysis breakthrough that has thwarted hundreds of professional crypto people.

This is unlikely.

Re:The Cryptographic Doom Principle by stouset on Tuesday April 14, 2015 @01:07PM (#9375702)
In madez's case, his construct is provably secure, with some caveats. Specifically, the first cipher must be a secure cipher, and the keys for both ciphers must be independent. If the latter is not the case, the custom cipher could very easily leak bits of the key, which would allow the original cipher to be broken.

But more importantly, it's the implementation of this construct that's likely to introduce weaknesses. As I posted in my direct reply to him, the problem is that no real world protocol is so simple, and he will now have to implement this. See OpenSSL for what can go wrong when implementing ciphers; and that's a highly-used, generally stable project that's had the benefit of multiple eyeballs for years.

Re:The Cryptographic Doom Principle by rudolf0 on Tuesday April 14, 2015 @02:11PM (#9376196)
Exactly. And if the first cipher is a secure cipher, with no obvious sign it'll be broken any time soon (like AES), why not just use it instead of wrapping it over some homebrew solution?
Re:The Cryptographic Doom Principle by madez on Tuesday April 14, 2015 @02:29PM (#9376301)
Because you get obscurity which makes automated cryptoanalysis of your communication a lot harder (if not impossible) which in turn makes untargeted surveillance more expensive.
Re:The Cryptographic Doom Principle by rudolf0 on Tuesday April 14, 2015 @03:37PM (#9376735)
That seems ridiculous for 2 reasons.

First, ciphertext is ciphertext. They'd probably be able to determine it's a block cipher and what the block size is, but that's about it. They're not going to be able to tell AES ciphertext from 3DES ciphertext if they're both set to use the same block size. There's no point "obscuring" the fact that you're using AES.

Second, if you're assuming the NSA seriously has the capability to break AES within the next 10 years, then obscuring it with a homebrew cipher is pointless, because they've probably already used their AES decryption capability to find many other ways into your system (through a hosting provider, ISP, domain registrar, DNS provider, admin accounts of coworkers...).

Even quantum algorithms are only able to halve the bits of the key search space (so 2^256 will become 2^128, which is still mostly infeasible even against a government adversary).

I don't think your suggestion would decrease security, if implemented perfectly (which is unlikely), even if the cipher is insecure and vulnerable to cryptanalysis. But I don't think it would increase security either. And since it wouldn't increase it, yet may decrease it in practice due to an implementation flaw which compromises both ciphers, why bother?

Re:The Cryptographic Doom Principle by madez on Tuesday April 14, 2015 @04:12PM (#9376946)
> First, ciphertext is ciphertext. They'd probably be able to determine it's a block cipher and what the block size is, but that's about it. They're not going to be able to tell AES ciphertext from 3DES ciphertext if they're both set to use the same block size. There's no point "obscuring" the fact that you're using AES.

If you can break a set of ciphers it's trivial to determine which was used for a connection, if one was used; You just try each.

The whole point is to hide which is the real cipher to make it more costly to attack you. Making it more costly for the attacker is what we want.

> Second, (...)

This is no argument for or against the scheme I presented.

> Even quantum algorithms are only able to halve the bits of the key search space (so 2^256 will become 2^128, which is still mostly infeasible even against a government adversary).

Breaking a cipher means to not have to search all the key space. That's the definition of a broken cipher.

> I don't think your suggestion would decrease security, if implemented perfectly (which is unlikely), even if the cipher is insecure and vulnerable to cryptanalysis. But I don't think it would increase security either. And since it wouldn't increase it, yet may decrease it in practice due to an implementation flaw which compromises both ciphers, why bother?

We disagree on the practicality of implementing it without adding another vulnerability to your system.

Re:The Cryptographic Doom Principle by rudolf0 on Tuesday April 14, 2015 @04:28PM (#9377081)
The plausibility of a vulnerability in AES which reduces the search space by more than half of the key bits is essentially 0.
Re:The Cryptographic Doom Principle by bandrami on Wednesday April 15, 2015 @12:31AM (#9378886)
First, ciphertext is ciphertext. They'd probably be able to determine it's a block cipher and what the block size is, but that's about it.

You can tell mode somewhat reliably (I've hit 75% confidence or so) by the entropy content of the ciphertext, and I've never done a Markov chain longer than a native word so I'd assume that gets better the longer your chain is. I would also assume people much smarter than me have compiled heuristics that are more useful than just determining the mode.

Re:The Cryptographic Doom Principle by frankchn on Wednesday April 15, 2015 @01:10AM (#9378995)
I believe it is considered a significant break in a block cipher if you can distinguish messages encrypted via that cipher against random bits constructed in a similar way (i.e. constructing an adversary such that it has a non-negligible advantage in the PRF security game against the family of functions for the block cipher).
Re:The Cryptographic Doom Principle by bandrami on Tuesday April 14, 2015 @11:36PM (#9378772)
I need to see a citation for this

You're looking at it the wrong way. You need to demonstrate for yourself that nothing in your cipher undoes the last round of the underlying cipher.

Re:The Cryptographic Doom Principle by madez on Tuesday April 14, 2015 @12:12PM (#9375274)
Rendering KC useless by using CC as I described is equivalent to breaking KC. There is no other way of messing with KC when used the way I said. And you won't break KC by chance with your CC. Many people respond like you did and they simply didn't think about what I've said and repeat old ideas.

I hate people.

Re:The Cryptographic Doom Principle by sirclueless on Tuesday April 14, 2015 @12:28PM (#9375401)
This is not a true statement. CC may leak information about the plaintext in ways that KC can't handle, even without breaking it. For example, applying CC might deterministically affect the message length.

One of my favorite cryptographic attacks ever was of this form, known as the CRIME attack [1]. It was a "partial plaintext" attack, where the "CC" in question was plain old gzip. Basically the attackers controlled a small part of the plaintext (for example, a field in an HTTPS request they could send with CSRF) and they were able to use known properties of the CC to get some information to leak into the message length -- namely, if the message fragment they controlled appeared elsewhere in the request, the gzip encoding would be shorter, and hence the encrypted request would be shorter. This is something that happens even with a "perfect" KC that no one could break.

[1]: http://en.wikipedia.org/wiki/CRIME

This is one of the defining characteristics of cryptography to me -- there are no perfect cyphers, there are only good systems. Littering extra cryptography around nearly always decreases security. The most secure system is the simplest system that works.

Re:The Cryptographic Doom Principle by dustyleary on Tuesday April 14, 2015 @12:45PM (#9375539)
What you (and the wiki link) are describing is plaintext -> CC (gzip) -> KC.

This is different than the argument you're replying to which is plaintext -> KC -> CC.

Re:The Cryptographic Doom Principle by madez on Tuesday April 14, 2015 @12:40PM (#9375489)
Read this thread again. Your statement is not correct since CC never gets to see the plaintext. CC is just a bijective function on (blocksize of KC) bits.
Re:The Cryptographic Doom Principle by sirclueless on Tuesday April 14, 2015 @12:49PM (#9375568)
Did you edit your post? I'm not the only one who misread it. If KC is applied first to the plaintext, then assuming you didn't flub anything in implementation the combined scheme won't be less secure than KC, I agree. Applying CC effectively becomes security through obscurity, which is admittedly sometimes helpful.
Re:The Cryptographic Doom Principle by madez on Tuesday April 14, 2015 @01:17PM (#9375757)
No, sirclueless, I didn't change the scheme I wrote about.

Yes, it adds security through obscurity without losing security through well-known recommended ciphers.

Re:The Cryptographic Doom Principle by stouset on Tuesday April 14, 2015 @02:04PM (#9376139)
If you use the same key for KC and CC, CC can (and hell, in all likelihood probably does) leak bits of the key.

So yes, there is a way of breaking this construct when used the way you said.