News for hackers. Stuff that matters.
Re:Teensy weensy crypto by lisper on Thursday November 12, 2015 @05:24PM (#10556587)
Just in case anyone is tempted to actually use this and hasn't gotten the memo: RC4 is broken and has been for some time now.
Re:Teensy weensy crypto by mikeash on Thursday November 12, 2015 @09:27PM (#10557666)
Let's say you wanted to implement a more modern, not (yet?) broken algorithm instead of RC4. Are there any which could fit into a similarly small amount of code?
Re:Teensy weensy crypto by hatsunearu on Friday November 13, 2015 @01:25PM (#10561401)
https://en.wikipedia.org/wiki/Speck_%28cipher%29

Speck's pretty nice and tiny, but who knows if it's backdoored or not :)

Re:Teensy weensy crypto by mikeash on Friday November 13, 2015 @02:43PM (#10561964)
That is a pretty sweet reference implementation. Thanks for the link.
Re:Teensy weensy crypto by lisper on Friday November 13, 2015 @02:56AM (#10558515)
I like TEA (or XTEA or XXTEA). Not quite as small as RC4 but still pretty compact.

https://en.wikipedia.org/wiki/Tiny_Encryption_Algorithm

Re:Teensy weensy crypto by swiley on Thursday November 12, 2015 @10:00PM (#10557770)
RSA is pretty short (just modular exponentiation). The problem is all the stuff that goes around it: key generation, padding etc.
Re:Teensy weensy crypto by Rebelgecko on Friday November 13, 2015 @02:32AM (#10558456)
Maybe not quite that small, but if you look up some "lightweight block ciphers", you can find some candidates.
Re:Teensy weensy crypto by JoachimSchipper on Friday November 13, 2015 @01:20AM (#10558289)
With Intel's instructions, AES-GCM is decently short. ;-)
Re:Teensy weensy crypto by mikeash on Friday November 13, 2015 @01:38PM (#10561508)
That is both hilarious and practical.
Re:Teensy weensy crypto by nothrabannosir on Thursday November 12, 2015 @05:28PM (#10556613)
Any comment on this?

Is RC4 secure? For this use-case, yes. For TLS, most certainly not. Even today there are many plausible attacks against RC4 in the TLS context, but none of them apply to this static-data world.

Re:Teensy weensy crypto by aidenn0 on Thursday November 12, 2015 @05:34PM (#10556647)
RC4 is no longer considered secure for most any purpose. There is known bias in the first few bytes of the cipher that can allow for key-recovery with enough messages sent with the same key. In general you want "head room" in your ciphers such that the best attacks today are not just impractical, but wildly impractical, because attacks tend to get better over time.

RC4 was known to not have this "head room" for a while, and now is largely broken.

Re:Teensy weensy crypto by tptacek on Thursday November 12, 2015 @06:10PM (#10556860)
There are biases throughout the whole RC4 keystream, not just in the first few bytes. RC4 is totally broken.
Re:Teensy weensy crypto by ultramancool on Thursday November 12, 2015 @06:36PM (#10556982)
If you cannot have something continue to produce output though those periodic biases cannot be obtained, To my knowledge you need a quite large amount of output to exploit them.

So for encrypting a single short message, where an attacker is unable to obtain more output, this should be sufficient for such a purpose.

Still, I wouldn't use it at all, there are other micro alternatives like TweetNaCl which offer a far higher degree of security.

Re:Teensy weensy crypto by aidenn0 on Thursday November 12, 2015 @08:39PM (#10557503)
> So for encrypting a single short message, where an attacker is unable to obtain more output, this should be sufficient for such a purpose.

This is fairly vacuous as there are tons of really broken cryptosystems for which this is true; futhermore if you are going to only send a single short message with a given key, an OTP could probably be described in 140 characters of English prose and requires no machine to implement.

Re:Teensy weensy crypto by tptacek on Thursday November 12, 2015 @09:30PM (#10557673)
It's not vacuous, but there is a history of cryptosystems that have tried and failed to sidestep that RC4 weakness by burning off keystream, so it's worth being careful about it.
Re:Teensy weensy crypto by kybernetikos on Friday November 13, 2015 @04:18AM (#10558789)
"This use-case" indicates to me a single message encrypted with a single passphrase.