A toy XOR surface starts with equal-length plaintext and keystream bytes.

highlighted = computed this step

Start with a toy XOR surface

The toy message says pay equals 10. A pinned keystream has the same byte length.

plaintext=0x7061793d3130\text{plaintext}=0x7061793d3130
Plaintext and keystreamToy XOR encryption and decryption are recomputed from pinned bytes.Plaintext48 bits / 6 bytes0x7061793d3130byte 0byte 1byte 2byte 301110000011000010111100100111101byte 4byte 50011000100110000byte-00x70byte-10x61byte-20x79byte-30x3dbyte-40x31byte-50x30Keystream48 bits / 6 bytes0x0f1e2d3c4b5abyte 0byte 1byte 2byte 300001111000111100010110100111100byte 4byte 50100101101011010byte-00x0fbyte-10x1ebyte-20x2dbyte-30x3cbyte-40x4bbyte-50x5aCiphertext48 bits / 6 bytes0x7f7f54017a6abyte 0byte 1byte 2byte 301111111011111110101010000000001byte 4byte 50111101001101010byte-00x7fbyte-10x7fbyte-20x54byte-30x01byte-40x7abyte-50x6aToy XOR rows - changed byte 4rowvaluecheckplaintext7061793d3130pinned byteskeystream0f1e2d3c4b5apinned bytesciphertext7f7f54017a6aplaintext xor keystreamtarget plaintext7061793d3930attacker targetattack mask000000000800plaintext xor targetmodified ciphertext7f7f5401726aciphertext xor maskdecrypted modified7061793d3930modified ciphertext xor keystream

Plaintext bytes

The plaintext bytes are 0x7061793d3130. The byte view is exact; no character parser runs in the browser.

plaintext bytes=0x7061793d3130\text{plaintext bytes}=0x7061793d3130
Plaintext and keystreamToy XOR encryption and decryption are recomputed from pinned bytes.Plaintext48 bits / 6 bytes0x7061793d3130byte 0byte 1byte 2byte 301110000011000010111100100111101byte 4byte 50011000100110000byte-00x70byte-10x61byte-20x79byte-30x3dbyte-40x31byte-50x30Keystream48 bits / 6 bytes0x0f1e2d3c4b5abyte 0byte 1byte 2byte 300001111000111100010110100111100byte 4byte 50100101101011010byte-00x0fbyte-10x1ebyte-20x2dbyte-30x3cbyte-40x4bbyte-50x5aCiphertext48 bits / 6 bytes0x7f7f54017a6abyte 0byte 1byte 2byte 301111111011111110101010000000001byte 4byte 50111101001101010byte-00x7fbyte-10x7fbyte-20x54byte-30x01byte-40x7abyte-50x6aToy XOR rows - changed byte 4rowvaluecheckplaintext7061793d3130pinned byteskeystream0f1e2d3c4b5apinned bytesciphertext7f7f54017a6aplaintext xor keystreamtarget plaintext7061793d3930attacker targetattack mask000000000800plaintext xor targetmodified ciphertext7f7f5401726aciphertext xor maskdecrypted modified7061793d3930modified ciphertext xor keystream

Keystream bytes

The toy keystream is 0x0f1e2d3c4b5a. It is just pinned bytes for this lesson, not real AES output.

keystream=0x0f1e2d3c4b5a\text{keystream}=0x0f1e2d3c4b5a
Plaintext and keystreamToy XOR encryption and decryption are recomputed from pinned bytes.Plaintext48 bits / 6 bytes0x7061793d3130byte 0byte 1byte 2byte 301110000011000010111100100111101byte 4byte 50011000100110000byte-00x70byte-10x61byte-20x79byte-30x3dbyte-40x31byte-50x30Keystream48 bits / 6 bytes0x0f1e2d3c4b5abyte 0byte 1byte 2byte 300001111000111100010110100111100byte 4byte 50100101101011010byte-00x0fbyte-10x1ebyte-20x2dbyte-30x3cbyte-40x4bbyte-50x5aCiphertext48 bits / 6 bytes0x7f7f54017a6abyte 0byte 1byte 2byte 301111111011111110101010000000001byte 4byte 50111101001101010byte-00x7fbyte-10x7fbyte-20x54byte-30x01byte-40x7abyte-50x6aToy XOR rows - changed byte 4rowvaluecheckplaintext7061793d3130pinned byteskeystream0f1e2d3c4b5apinned bytesciphertext7f7f54017a6aplaintext xor keystreamtarget plaintext7061793d3930attacker targetattack mask000000000800plaintext xor targetmodified ciphertext7f7f5401726aciphertext xor maskdecrypted modified7061793d3930modified ciphertext xor keystream

Summary

Toy XOR encryption starts with equal-length plaintext and keystream bytes.

byte length=6\text{byte length}=6
Plaintext and keystreamToy XOR encryption and decryption are recomputed from pinned bytes.Plaintext48 bits / 6 bytes0x7061793d3130byte 0byte 1byte 2byte 301110000011000010111100100111101byte 4byte 50011000100110000byte-00x70byte-10x61byte-20x79byte-30x3dbyte-40x31byte-50x30Keystream48 bits / 6 bytes0x0f1e2d3c4b5abyte 0byte 1byte 2byte 300001111000111100010110100111100byte 4byte 50100101101011010byte-00x0fbyte-10x1ebyte-20x2dbyte-30x3cbyte-40x4bbyte-50x5aCiphertext48 bits / 6 bytes0x7f7f54017a6abyte 0byte 1byte 2byte 301111111011111110101010000000001byte 4byte 50111101001101010byte-00x7fbyte-10x7fbyte-20x54byte-30x01byte-40x7abyte-50x6aToy XOR rows - changed byte 4rowvaluecheckplaintext7061793d3130pinned byteskeystream0f1e2d3c4b5apinned bytesciphertext7f7f54017a6aplaintext xor keystreamtarget plaintext7061793d3930attacker targetattack mask000000000800plaintext xor targetmodified ciphertext7f7f5401726aciphertext xor maskdecrypted modified7061793d3930modified ciphertext xor keystream