0

I am using one-time pad cipher. When we use same key on two texts (m1, m2) then c1⊕c2 = m1⊕m2. Why isn't it the same? What am I missing?

Here is example:

m1: dog  - 011001000110111101100111
m2: cat  - 011000110110000101110100
key: pas - 011100000110000101110011

c1: soy  - 011100110110111101111001
c2: ral  - 011100100110000101101100

m1 xor m2:  11011101111101011011100111111
c1 xor x2:  10110000010000000110000100
ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
Tomas Kanok
  • 105
  • 10
  • Are you sure you are actually using xor and not "plain" or? When 1 appears in both m1 and the key (in the corrosponding position), the result in the ciphertext should be 0. Edit: now your c1 xor c2 value isn't matching your current c1/c2. – VoidStar Mar 26 '15 at 11:41
  • That formula works when c1 is the cipher for m1, etc. e.g. c1 = m1⊕key. As I look harder, c1 looks like some other random ciphertext. – VoidStar Mar 26 '15 at 11:46
  • you are right. I used some online encrypter which show bad results. I did it on paper and everything is fine. Thank you – Tomas Kanok Mar 26 '15 at 12:37

0 Answers0