8 ms·
SIMON and SPECK are both pretty straightforward block cipher designs. You can implement them in less than 100 lines of code. There are no s-boxes or weird const
by tptacek 9y ago
SIMON and SPECK are both pretty straightforward block cipher designs. You can implement them in less than 100 lines of code. There are no s-boxes or weird constants. Unlike a lot of what NSA designs, they were published formally, with design papers that included rationales. The software-optimized cipher (SPECK) is a simple ARX design. The hardware-optimized cipher (SIMON) uses bitwise operations instead of AND. This is pretty mainstream stuff. It is very unlikely that they harbor backdoors.
(The point of both algorithms is to provide scalable low-profile crypto, instantiable at very small key and block sizes; this is something you'd want if you were, for instance, building an encrypted IOT scheme on microcontrollers).
That doesn't mean they should be international standards; maybe it makes sense that after Dual EC, the NSA doesn't have a shot at producing a global standard for low-profile encryption. But however well justified, it's mostly a political decision, not a technical one.
- SomeStupidPoint 9y agoThis is a tangent but... > SIMON and SPECK are both pretty straightforward block cipher designs. You can implement them in less than 100 lines of code. If I super promise to never let the code off my computer, can you point me to resources to do that for educational purposes?
- tptacek 9y agoGoogle [filetype:pdf SIMON SPECK]. If you've never implemented a cipher before, they're both pretty good first ciphers to implement. They're simple without being unrealistically simple, like RC4. The paper has test vectors, so you can make sure what you come up with is actually correct.
- Rebelgecko 9y agoOne of their talks has a tweet sized implementation, if you want to look at that. If you don't want to be "spoiled" be careful reading the original paper because it has Speck in C IIRC. They're also good algorithms if you want practice with SIMD instructions. http://csrc.nist.gov/groups/ST/lwc-workshop2015/papers/session1-shors-paper.pdf http://csrc.nist.gov/groups/ST/lwc-workshop2015/papers/sessi...
- wallace_f 9y ago>it's mostly a political decision, not a technical one. Is there a good reason to trust the NSA's motivations? The NSA's stated motivation from the article: >encryption tools [...] without requiring a lot of computer processing power. But it was noted that: >“There are probably some legitimate questions around whether these ciphers are actually needed,” said Curtis Dukes, who retired earlier this year. Similar encryption techniques already exist, and the need for new ones is theoretical, he said. The NSA's purpose is as a spy agency. No matter how effective that clear coat they're selling you might actually be, they're probably selling you on something you really don't need because it has a benefit to their purpose.
- ethbro 9y agoThe NSA is dual purpose. Both as a signals spy agency and a signals counterintelligence agency. And ultimately, what's the difference between a publicly vetted algorithm proposed by the NSA and a publicly vetted algorithm proposed by someone else? Everyone points at the Dual EC fiasco, but if vulnerabilities are possible either way it seems like throwing the baby out with the bathwater.
- gnode 9y agoAny food could be poisonous, possibly with a poison you don't know how to detect. Would you rather eat food prepared by someone known to have poisoned you before, with obvious motivation to poison you again, or someone with no history of poisoning people? In no case are you guaranteed to not have poisoned food, but I know which I'd prefer.
- tptacek 9y agoThere's a strain of anti-intellectualism here. It's actually not true that any algorithm might be backdoored. Algorithms aren't unknowable. Furthermore, people act like there's a track record of super-sneaky NSA backdoors, and that Dual EC shows we can't trust anything NSA produces. I don't trust the NSA at all. But Dual EC wasn't sneaky. There were only two surprising things about Dual EC: (1) That they actually managed to get anyone to use it, despite how clunky and slow and unreasonable the design was. (2) That having produced a design that stuck out like a sore thumb for clunkiness, slowness, and unreasonableness, that design would be their backdoor; we gave them a lot more credit for tradecraft than that. People knew there was something shady about Dual EC almost from the jump. It is a random number generator that works by encrypting random state with a public key for which the private key is undisclosed. It's obviously weird. That's not the case with SPECK and SIMON. They're mainstream designs, and, more importantly, if you can hide a backdoor in a simple ARX Feistel block cipher that can be implemented in 100 lines of code, we probably have bigger concerns than these algorithms. Should you use SIMON and SPECK? Of course not. You shouldn't go anywhere near lightweight ciphers unless you know exactly what you're doing, and if you know exactly what you're doing, there are less politically controversial lightweight ciphers to use. The problem here isn't that the world is being deprived of SIMON and SPECK; it's that we're getting too practiced at turning our brains off.
- snakeanus 9y agoI don't see why would they bother with them when things like Chacha20 (which is a popular and well audited algorithm) already exist.
- tptacek 9y agoChaCha20 isn't a lightweight stream cipher.
- twotwotwo 9y agoI agree the biggest worry isn't a hidden attack on the high parameter modes. The weak modes, though! A 32-bit block(!), 64-bit key, and 22 XOR/add/XOR rounds is just an excuse to say you have int'l standard crypto despite it being painfully weak. If we see demand for a standard cheaper than hardware AES or software ChaCha20 (or 12 if you live dangerously), we should pick one in an open process like the many we've had.
- ryacko 9y agoI thought the weak modes were to more easily crypto analyze it.
- twotwotwo 9y agoMy understanding is what tptacek said: they were proposed for real-world use, with IoT and other small/embedded platforms as the justification.
- tptacek 9y agoThe small block and key sizes aren't about export controls (obviously, since the standard comes with 128/256); it's for platforms that can't afford serious block and key sizes.
- twotwotwo 9y agoYeah, "int'l standard" in my comment referred to standardization by the International Standards Organization, not the old "international" export-strength keys. I'm saying I think standardizing weak params is a bad idea, even if strong ones are offered too; it gives folks who could afford sane block/key sizes an excuse to cheap out and use something bad and say "it's standard." To the extent industry is calling for cheaper crypto, there are some existing civilian candidates (like the eSTREAM hardware profile though I haven't seen much interest in it), or we could have an open competition, responding to what civilian security folks say they're missing. You could definitely get, e.g. gate area down vs. AES or ChaCha without sacrificing sane block/key sizes.
- tptacek 9y ago(i hope it's obvious I meant "instead of ADD", not "instead of AND").