3 ms·
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
by striking 12y ago
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.)
- bluedino 12y agoIt'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!"
- nawitus 12y agoTinfoil 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 https://www.cs.helsinki.fi/u/oottela/tfc.pdf
- stouset 12y agoOne-time pads are also trivially malleable. Flip a bit in the ciphertext, and the same bit flips in the plaintext.
- odonnellryan 12y agoLet the end user worry about data integrity. ;)