3 ms·
XOR is not, by itself, a problem. Heck, the most secure encryption method on the entire planet, the one time pad[1], is just an XOR of some secret bytes with a
by sirclueless 12y ago
XOR is not, by itself, a problem. Heck, the most secure encryption method on the entire planet, the one time pad[1], is just an XOR of some secret bytes with a plaintext. XOR is also one of two fundamental building blocks of the current state-of-the-art AES-256 encryption algorithm[2] (the other being a series of bit shifts).
The problem here is deriving something so simple from the key, and only applying it to the first 128 bytes. This is unforgivably dumb, when there are perfectly serviceable encryption services available as part of open source libraries, such as the aforementioned AES-256 algorithm.
[1]: http://en.wikipedia.org/wiki/One-time_pad http://en.wikipedia.org/wiki/One-time_pad
[2]: http://en.wikipedia.org/wiki/Advanced_Encryption_Standard#The_AddRoundKey_step http://en.wikipedia.org/wiki/Advanced_Encryption_Standard#Th...
- sarciszewski 12y agoWhen I said XOR I meant XOR with a one-byte key on every character of input. e.g. char* xor_encrypt(char* input, char key) { int i; int m = sizeof(input); output = (char*)malloc((int) m + 1); for (i = 0; i < m; i++) { output[i] = input[i] ^ key; } output[m] = 0; return output; }
- MatthewWilkes 12y agoXOR is only one implementation of one time pad, it is also commonly used with modular addition. If you do it with letters then it effectively becomes a Vigenère cipher with a long key. The one-time-pad is a special case of any number of poly-alphabetic substitution ciphers, XOR just being one that happens to be implemented on lots of silicon. Considering this is all about an app that has very short keys (a few numeric digits) it's perfectly legitimate to criticise the use of a substitution cipher as they are especially poor when used with short keys compared to real crypto libraries that will use that short key as the passphrase for a real key.
- duaneb 12y agoWell it's not the XOR that's special, it's the secret part that is. Without the value being secret, it might as well not be encrypted.