3 ms·
Incorrect, if the key is shared the encryption is breakable. If you're just doing one round of XOR it's pretty easy to break the key given a known plaintext, in
by fleitz 11y ago
Incorrect, if the key is shared the encryption is breakable. If you're just doing one round of XOR it's pretty easy to break the key given a known plaintext, in the same way that AES is very breakable in ECB mode.
For unbreakable encryption, I'd suggest XORing with the contents of /dev/random (assuming /dev/random is unknowable). Of course decryption may be an issue.
- schoen 11y agoIn context, I'm sure the parent commenter meant "a random key the same length as the plaintext", not a repeating key or a reused key.
- mmaunder 11y agoWrong. It's just not secure in all contexts e.g. your example where you have a known plaintext that you can use to crack the key which then lets you decrypt something encrypted with the same key. You're discovering why XOR isn't widely used in a real-world setting.
- deleted 11y ago[deleted]
- dllthomas 11y ago"If you're just doing one round of XOR it's pretty easy to break the key" If you're doing two rounds, it's even easier!