Bruce Schneier | |||||||||
Schneier on SecurityA blog covering security and security technology. « Today's Movie-Plot Threat: Electronic Pulses from Space | Main | Vote Someone Else's Shares » November 23, 2005Twofish Cryptanalysis RumorsRecently I have been hearing some odd "Twofish has been broken" rumors. I thought I'd quell them once and for all. Rumors of the death of Twofish has been greatly exaggerated. The analysis in question is by Shiho Moriai and Yiqun Lisa Yin, who published their results in Japan in 2000. Recently, someone either got a copy of the paper or heard about the results, and rumors started spreading. Here's the actual paper. It presents no cryptanalytic attacks, only some hypothesized differential characteristics. Moriai and Yin discovered byte-sized truncated differentials for 12- and 16-round Twofish (the full cipher has 16 rounds), but were unable to use them in any sort of attack. They also discovered a larger, 5-round truncated differential. No one has been able to convert these differentials into an attack, and Twofish is nowhere near broken. On the other hand, they are excellent and interesting results -- and it's a really good paper. In more detail, here are the paper's three results:
The paper theorizes that all of these characteristics might be useful in an attack, but I would be very careful about drawing any conclusions. It can be very tricky to go from single-path characteristics whose probability is much smaller than the chances of it happening by chance in an ideal cipher, to a real attack. The problem is in the part where you say "let's just assume all other paths behave randomly." Often the other paths do not behave randomly, and attacks that look promising fall flat on their faces. We simply don't know whether these truncated differentials would be useful in a distinguishing attack. But what we do know is that even if everything works out perfectly to the cryptanalyst's benefit, and if an attack is possible, then such an attack is likely to require a totally unrealistic number of chosen plaintexts. 2100 plaintexts is something like a billion billion DVDs' worth of data, or a T1 line running for a million times the age of the universe. (Note that these numbers might be off by a factor of 1,000 or so. But honestly, who cares? The numbers are so huge as to be irrelevent.) And even with all that data, a distinguishing attack is not the same as a key recovery attack. Again, I am not trying to belittle the results. Moriai and Yin did some great work here, and they deserve all kinds of credit for it. But even from a theoretical perspective, Twofish isn't even remotely broken. There have been no extensions to these results since they were published five years ago. The best Twofish cryptanalysis is still the work we did during the design process: available on the Twofish home page. Posted on November 23, 2005 at 12:15 PM • 33 Comments • View Blog Reactions To receive these entries once a month by e-mail, sign up for the Crypto-Gram Newsletter. If someone did break Twofish, would you be saddened at all? I'm sure you would be impressed, but would there be even a twinge of disappointment? Just curious. Posted by: Jarrod at November 23, 2005 12:47 PM Of course I would be disappointed. But I would be really impressed. And I would likely learn a lot from the analysis. This is the way cryptography works. Algorithms get proposed, and they get broken. One of my algorithms, MacGuffin, was broken during the rump session of the workshop it was presented. Embarrassing, yes. But that's okay. Breaking is actually much more satisfying than designing. With designing, there's always an element of doing the best you can and hoping for the best. With analysis, the proof is in the pudding. If truth be known, I would like to be the one to break Twofish. Posted by: Bruce Schneier at November 23, 2005 12:51 PM After someone breaks Twofish you could always come up with an algorithm called FiveLoavesOfBread. or was that the other way around? ;-) Stu Posted by: Stu Savory at November 23, 2005 12:58 PM Blowfish was before Twofish. I kind of liked Redfish and Quadfish, but we seem to be going off in another direction entirely: Helix, Phelix. Posted by: Bruce Schneier at November 23, 2005 1:03 PM What, exactly, is a distinguishing attack? A brief search seems to imply that it just allows one to distinguish between a cyphertext stream and a stream of random bits, but doesn't actually break an algorithm. Posted by: Mithrandir at November 23, 2005 1:26 PM "[...] the proof is in the pudding." Nope, not there. I looked! Sorry, just one of my pet peeves... the expression is The proof of the pudding is in the eating. Posted by: stacy at November 23, 2005 1:36 PM Tongue-in-cheek-suggestion: Please refer to any new algorithms with names such as TITANIUM or ATOMIC. Something very strong sounding. I have recently been having internal audit complaining to me about the use of Pretty Good Privacy in our organization: "Shouldn't we be using something stronger than just 'pretty good' ?" Posted by: Jim at November 23, 2005 1:41 PM Bruce, here you say the best cryptanalysis was the work during the design process and provide a link. On that page you say the best cryptanalysis is the work by Moriai and Yin. Sorry - just a niggling nit. Thanks for your vision in making twofish open, uncopyrighted and patent free. This is why I gladly buy your books than downloading them free from P2P networks ;) Posted by: A Prohias at November 23, 2005 2:27 PM Jim -- it is certainly true that the name you give can have some impact on how someone perceive it. However, that is a double edged sword because what happens if this hypothetical algorithm -- Titanium -- wound up being broken? Then the name becomes a misrepresentation, and we do not want it to stick with the algorithm...do we? Really, I think the name is all just marketing. Any good auditor should know that Pretty Good Privacy is probably one of the best the organization could be using. That is what security should be about -- keeping up with what is currently considered the best. Posted by: Tim Vail at November 23, 2005 2:33 PM Stacy said: > Nope, not there. I looked! Sorry, just > The proof of the pudding is in the And the word proof here is in the sense of test, as opposed to confirmation. Like in proving ground. Another common, and much misunderstood phrase where prove is used in this sense is: The exception proves the rule. If you read this as the exception tests the rule it makes sense, if you read it as the exception confirms the rule it's a contradiction! Posted by: Rick at November 23, 2005 2:37 PM > The exception proves the rule.
More details can be found (at the bottom of the page) on The Straight Dope's answer to this question. And one of the few where Cecil initially got it wrong! :) Posted by: Ithika at November 23, 2005 3:02 PM "Blowfish was before Twofish. I kind of liked Redfish and Quadfish" No! After Twofish and Redfish, the only thing that can come next is Bluefish! (By the way, what happened to Onefish?) Posted by: RandomOlderPerson at November 23, 2005 3:52 PM "What, exactly, is a distinguishing attack? A brief search seems to imply that it just allows one to distinguish between a cyphertext stream and a stream of random bits, but doesn't actually break an algorithm." Yes. That's exactly what a distinguishing attack is. One of the properties of a good algorithm is that its output is indistinguishable from a random stream of bits. A successful distinguishing attack breaks that property. The attack does not recover the key, nor does it allow anyone to decrypt any ciphertext. But it's still a pretty serious attack, and I would recommend that any algorithms that permit such an attack be replaced. Like the attack against SHA-1, it wouldn't be a crisis, but it would be a good idea to start upgrading. Posted by: Bruce Schneier at November 23, 2005 3:58 PM "Bruce, here you say the best cryptanalysis was the work during the design process and provide a link. On that page you say the best cryptanalysis is the work by Moriai and Yin. Sorry - just a niggling nit." Oops. I'll fix the Twofish page. Posted by: Bruce Schneier at November 23, 2005 3:59 PM "Please refer to any new algorithms with names such as TITANIUM or ATOMIC. Something very strong sounding." We're cryptographers. Marketing is down the hall. Posted by: Bruce Schneier at November 23, 2005 4:00 PM @Tim Vail, Names can be more important than you think in the minds of those that deal with perceptions rather than reality (i.e. marketing, management, politice etc.) Open source software proponents are still fighting with the "free" label, trying to explain the differance between free-as-in-beer (gratis) and free-as-in-speech (libre). Bruce, you want to break TwoFish yourself? Aren't you afraid the tin-foil-hatters are going to acuse you of "doing a DES/NSA" and hiding a deliberate weakness? Posted by: free-as-in-steak-knives at November 23, 2005 4:06 PM "Of course I would be disappointed. But I would be really impressed. And I would likely learn a lot from the analysis." I can see how this would be. I was wondering because sometimes I come up with some really neat bit of code (or so I think), and someone better at it than I points out a flaw. I don't get disappointed, but rather excited at the possibility of learning from the mistakes. "Breaking is actually much more satisfying than designing." Cryptography, like most of security, is a battle of wits, and like any other battle of wits, breaking an algorithm represents a victory in this battle. Victory is usually more satisfying than planning a defense. Posted by: Jarrod at November 23, 2005 4:24 PM @Jim, Posted by: Rubber Fortification at November 23, 2005 4:46 PM I much prefer names like Twofish, Rijndael, Phelix over Blowfish, MARS, Serpent, or TITANIUM and ATOMIC, because in the former case every Google hit is about the cipher. Posted by: Paul Crowley at November 23, 2005 5:11 PM @Jim, "Shouldn't we be using something stronger than just 'pretty good' ?" The correct reply to this is: ;-) Posted by: Philip Storry at November 23, 2005 6:32 PM Not to belabor a proverb, but "The exception proves the rule" has developed two distinct meanings. Ithika, you have the older legal definition. Rick has given the newer scientific definition. The latter comes from the scientific habit of looking for revealing special cases, because those can often distinguish between competing theories. As a quick example: Newtonian physics implies that light, with mass 0, should not be affected by (nor exert) gravity, because gravitational force is proportional to both masses involved. Einsteinian physics says it should, because even massless particles are affected by spatial curvature. By experiment, light is indeed affected by gravity, so Einstein "wins", and Newton gets demoted to an approximation. Posted by: David Harmon at November 23, 2005 6:48 PM Not specially in regards to twofish, but if you needed to encrypt a sensitive file on your home computer, what method would choose in today's world? And could you trust the encryption optioned provided by a commercial entity, such as Microsoft? (I would be afraid that they have a backdoor somewhere.) Posted by: Jeff Flowers at November 23, 2005 11:48 PM No, I like names that express the vagueness of the protection they offer. "pretty good privacy" is just that - it's pretty good, we think. Well, we hope. Kind of. If you use it right. And the hardware is secured. And the users are trained right. And no-one stuffs up. Mostly. Until someone breaks it. Calling something "the ultimate bombproof uncrackable encryptonometer, now with 3162 bit keys!" is likely to lead to people assuming it's so secure that they don't have to worry. Just read the Risks Digest and see how much of a problem this sort of thing is already... Posted by: Moz at November 24, 2005 2:02 AM "Not specially in regards to twofish, but if you needed to encrypt a sensitive file on your home computer, what method would choose in today's world?" I use PGP Disk. Posted by: Bruce Schneier at November 24, 2005 8:51 AM @Jeff Posted by: Yongqian at November 24, 2005 12:25 PM Thanks for the observations Bruce. Since one of the explicit design goals of AES candidates -- the reason for a 128 bit block -- was resistance to codebook attacks on the order of 2^64 blocks, I think distinguishing attacks requiring 2^100 chosen blocks can't even be regarded as certificational. Posted by: Roger at November 24, 2005 4:15 PM I thought everyone still considered it atleast as secure as the other NIST finalists. Posted by: Ari Heikkinen at November 25, 2005 1:04 PM "Rumors of the death of Twofish has been greatly exaggerated." Seriously? You mean "As opposed to the information about the algebraic attacks on Rijndael, which has been entirely accurate," don't-you? He who draws the sword ... Posted by: Vincent at November 25, 2005 3:55 PM Vincent, is that you? Or is it some other Vincent? If it's you, e-mail me. I am currently writing a new essay on Rijndael, and I have a few questions. If it's another Vincent: While there are some weird algebraic properties of Rijndael, no one has anything even remotely resembling an attack based on them. The biggest Rijndael skeptic right now is Arjen Lenstra, and he doesn't have anything except a seriously bad feeling. Right now, the most interesting positive development regarding Rijndael is its endorsement by the NSA, not just for Secret information but for Top Secret as well: http://www.nsa.gov/ia/industry/crypto_suite_b.cfm To me, this says a lot. Posted by: Bruce Schneier at November 25, 2005 4:25 PM About rijndael, I still don't understand why its simple algebraic structure would be any problem. I thought the very idea was the security of any encryption scheme must depend only on the key and not the algorithm (and it makes sense too, because say you're at war, your enemy is sure to get access to your hardware on the battlefield and thus get the algorithm eventually). Now, if an algorithm is clean, simple and easy to understand (for everyone), in my opinion, it's only a good thing. Relying on something that's complex and hard to analyze would be like relying on security through obscurity to me. Going back to that war analogy, relying on complexity, your enemy might be able to monitor your government and citizens because their experts were good enough to come up with an attack as opposed to your own experts (or perhaps even students who were given a chance to analyze the algorithm before use) who missed the attack because of the complexity of that algorithm. Posted by: Ari Heikkinen at November 29, 2005 1:44 PM The thing that is so cool with twofish is that its free, made by a group of professionals and has a history to back it up. I just never understood why it was 256 bits instead of 448 like blowfish??? Posted by: More Coffee (I like coffee) at February 21, 2007 6:18 PM Post a comment
Powered by Movable Type 3.36. Photo at top by Steve Woit.
Schneier.com is a personal website. Opinions expressed are not necessarily those of BT. |
|
Comments