title: Knowing plaintext composition rules, encryption algorithms, and 2 ciphertext blocks, how to find plaintext and keys
body: <p>Anna wants to send a message with a random arrangement of only 5 words, which are </p>
  
  <pre><code>INPUT, GET, HTTP, OUTPUT, POST 
  </code></pre>
  
  <p>like </p>
  
  <pre><code>INPUTGETOUTPUTPOSTGETHTTPHTTPINPUTGET
  </code></pre>
  
  <p>Each letter occupies 1 byte, and the entire message will be aligned to an integer multiple of <strong>128 bits</strong> by adding 0 at the end of the message. </p>
  
  <p>After getting the message to be sent, Anna divides it into several 128-bit (16 bytes=16 letters) plaintext blocks from beginning to end, like</p>
  
  <pre><code>INPUTGETOUTPUTPO, STGETHTTPHTTPINP, UTGET00000000000
  </code></pre>
  
  <p>Randomly pick 2 plaintext blocks P1 and P5, and use a same 128 bit key to get cipher block <code>C1 = P1 xor key</code> <code>C5 = P5 xor key</code>.</p>
  
  <p>Now suppose I am an adversary. I know all the above <strong>encryption algorithms</strong>, and intercepted 2 <strong>ciphertext blocks CA and CB</strong>, and can determine that 2 ciphertext blocks are generated by <strong>the same key K1</strong>.</p>
  
  <p>The question now is how to decrypt the key and 2 plaintext blocks with the above information.
  I have tried many ways, and the ideas are all broken. I am very grateful for the ideas and opinions that have helped me.</p>