Exclusive-OR Encryption Security (XOR)

XOR encryption is known to be pretty weak. But how weak is it, if I have a key consisting of several keys of different (ideally simple) lengths that are combined to make a longer key. for example, I have text keys of length 5, 9, and 11. If I just applied the first key using XOR encryption, then it should be easy to break, because the encryption byte will be repeated every 5 bytes. However, if I impose 3 of these keys, I get an effective non-repeating length of 5 * 9 * 11 = 495. That sounds pretty strong to me. If I use several verses of a poem, using each line as a key, then my repeated length will be longer than most files. How strong would that be (assuming the key remains secret! :))

+3
source share
3 answers

XOR encryption is just as strong as a key stream. If you are XOR with the “One time pad” - a sequence of physically generated random numbers that you use only once, then your encryption is theoretically indestructible. You have a problem, however, with hiding and distributing the key.

So, your question boils down to “how safe / random is the key stream of three text lines?” The answer is "not at all very safe." Probably good enough to hold your sister, but not necessary if you have a smart little sister like mine.

+6
source

P Q - , P (Q (x)) , P (x) Q (x), . - , . , , , .

+2

Source: https://habr.com/ru/post/1770094/


All Articles