One of the encryption techniques was to turn each letter into a series of 0s and 1s (sort of like Morse code), and then for each letter in the message add a random letter to it in a boolean 'Exclusive Or' (XOR) style. The same (a 0 and 0, or a 1 and a 1) would make a 0 when added together, and different (a 0 and a 1 or visa versa) ones would add to make a 1.
Imagine you wanted to say "Hi". For the sake of this exercise we're going to assume that A is 0001, B is 0010, H is 1000, and I is 1001. We'll also assume that the key here is AB (as in, we're adding an A and then a B).
H + A = I
1000 + 0001 = 1001
I + B = K (if we count up in binary for the alphabet like we did here)
1001 + 0010 = 1011
HI = IK
The brilliant thing about this system is that because of how it works, when you add the key to the encrypted message it will actually decrypt it:
I + A = H
1001 + 0001 = 1000
K + B = I
1011 + 0010 = 1001
Amazing.
Imagine you wanted to say "Hi". For the sake of this exercise we're going to assume that A is 0001, B is 0010, H is 1000, and I is 1001. We'll also assume that the key here is AB (as in, we're adding an A and then a B).
H + A = I
1000 + 0001 = 1001
I + B = K (if we count up in binary for the alphabet like we did here)
1001 + 0010 = 1011
HI = IK
The brilliant thing about this system is that because of how it works, when you add the key to the encrypted message it will actually decrypt it:
I + A = H
1001 + 0001 = 1000
K + B = I
1011 + 0010 = 1001
Amazing.
No comments:
Post a Comment