News for hackers. Stuff that matters.
Re:Show HN: Write (almost) perfect encryption in an hour by striking on Saturday January 24, 2015 @12:35PM (#8940251)
Unlike a modern cipher like AES, XOR is vulnerable to a known-plaintext attack. If your keys are truly random then you're fine, but otherwise you risk exposing enough random output from your RNG that a seed can be found.

Also, weak RNG. Use arc4random. (And /dev/urandom isn't insecure, either.)

Re:Show HN: Write (almost) perfect encryption in an hour by bluedino on Saturday January 24, 2015 @12:54PM (#8940319)
It's kind of a joke post. "Use a one-time pad! Proven unbreakable! And exchange the huge key on a physical CD with your intended destination!"
Re:Show HN: Write (almost) perfect encryption in an hour by nawitus on Saturday January 24, 2015 @01:02PM (#8940352)
Tinfoil Chat[1] is a semi-practical application of the one-time pad encryption.

The paper mentions the inconvenience of sending the keys:

>Another common argument is that unlike symmetric PSKs, OTP keys also eventually run out and users need to exchange another keyfile. The messages of TFC only consume 420 bytes of key material. The drop in the price of storage space has made the issue negligible: A $10 microSD card can store 4GB of keyfiles to encrypt more than 9 million messages, which is in most cases enough for several years or decades.

1. https://www.cs.helsinki.fi/u/oottela/tfc.pdf

Re:Show HN: Write (almost) perfect encryption in an hour by stouset on Saturday January 24, 2015 @12:58PM (#8940329)
One-time pads are also trivially malleable. Flip a bit in the ciphertext, and the same bit flips in the plaintext.
Re:Show HN: Write (almost) perfect encryption in an hour by odonnellryan on Saturday January 24, 2015 @01:03PM (#8940357)
Let the end user worry about data integrity. ;)