The toy shows malleability when no authentication check rejects the edit.
The receiver decrypts the changed bytes
With the same keystream, the modified ciphertext decrypts to the target plaintext. There is no authentication tag in this toy to reject the edit.
decrypted modified = 0 x 7061793 d 3930 \text{decrypted modified}=0x7061793d3930 decrypted modified = 0 x 7061793 d 3930
Unauthenticated change The target, attack mask, modified ciphertext, and decrypted result are recomputed. Target plaintext 48 bits / 6 bytes 0x7061793d3930 byte 0 byte 1 byte 2 byte 3 0 1 1 1 0 0 0 0 0 1 1 0 0 0 0 1 0 1 1 1 1 0 0 1 0 0 1 1 1 1 0 1 byte 4 byte 5 0 0 1 1 1 0 0 1 0 0 1 1 0 0 0 0 byte-0 0x70 byte-1 0x61 byte-2 0x79 byte-3 0x3d byte-4 0x39 byte-5 0x30 Attack mask 48 bits / 6 bytes 0x000000000800 byte 0 byte 1 byte 2 byte 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 byte 4 byte 5 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 byte-0 0x00 byte-1 0x00 byte-2 0x00 byte-3 0x00 byte-4 0x08 byte-5 0x00 Modified ciphertext 48 bits / 6 bytes 0x7f7f5401726a byte 0 byte 1 byte 2 byte 3 0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 1 byte 4 byte 5 0 1 1 1 0 0 1 0 0 1 1 0 1 0 1 0 byte-0 0x7f byte-1 0x7f byte-2 0x54 byte-3 0x01 byte-4 0x72 byte-5 0x6a Decrypted modified 48 bits / 6 bytes 0x7061793d3930 byte 0 byte 1 byte 2 byte 3 0 1 1 1 0 0 0 0 0 1 1 0 0 0 0 1 0 1 1 1 1 0 0 1 0 0 1 1 1 1 0 1 byte 4 byte 5 0 0 1 1 1 0 0 1 0 0 1 1 0 0 0 0 byte-0 0x70 byte-1 0x61 byte-2 0x79 byte-3 0x3d byte-4 0x39 byte-5 0x30 Toy bit flip rows - changed byte 4 row value check plaintext 7061793d3130 pinned bytes keystream 0f1e2d3c4b5a pinned bytes ciphertext 7f7f54017a6a plaintext xor keystream target plaintext 7061793d3930 attacker target attack mask 000000000800 plaintext xor target modified ciphertext 7f7f5401726a ciphertext xor mask decrypted modified 7061793d3930 modified ciphertext xor keystream
The controlled result
The decrypted modified plaintext is 0x7061793d3930, which says pay equals 90.
pay = 90 \text{pay}=90 pay = 90
Unauthenticated change The target, attack mask, modified ciphertext, and decrypted result are recomputed. Target plaintext 48 bits / 6 bytes 0x7061793d3930 byte 0 byte 1 byte 2 byte 3 0 1 1 1 0 0 0 0 0 1 1 0 0 0 0 1 0 1 1 1 1 0 0 1 0 0 1 1 1 1 0 1 byte 4 byte 5 0 0 1 1 1 0 0 1 0 0 1 1 0 0 0 0 byte-0 0x70 byte-1 0x61 byte-2 0x79 byte-3 0x3d byte-4 0x39 byte-5 0x30 Attack mask 48 bits / 6 bytes 0x000000000800 byte 0 byte 1 byte 2 byte 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 byte 4 byte 5 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 byte-0 0x00 byte-1 0x00 byte-2 0x00 byte-3 0x00 byte-4 0x08 byte-5 0x00 Modified ciphertext 48 bits / 6 bytes 0x7f7f5401726a byte 0 byte 1 byte 2 byte 3 0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 1 byte 4 byte 5 0 1 1 1 0 0 1 0 0 1 1 0 1 0 1 0 byte-0 0x7f byte-1 0x7f byte-2 0x54 byte-3 0x01 byte-4 0x72 byte-5 0x6a Decrypted modified 48 bits / 6 bytes 0x7061793d3930 byte 0 byte 1 byte 2 byte 3 0 1 1 1 0 0 0 0 0 1 1 0 0 0 0 1 0 1 1 1 1 0 0 1 0 0 1 1 1 1 0 1 byte 4 byte 5 0 0 1 1 1 0 0 1 0 0 1 1 0 0 0 0 byte-0 0x70 byte-1 0x61 byte-2 0x79 byte-3 0x3d byte-4 0x39 byte-5 0x30 Toy bit flip rows - changed byte 4 row value check plaintext 7061793d3130 pinned bytes keystream 0f1e2d3c4b5a pinned bytes ciphertext 7f7f54017a6a plaintext xor keystream target plaintext 7061793d3930 attacker target attack mask 000000000800 plaintext xor target modified ciphertext 7f7f5401726a ciphertext xor mask decrypted modified 7061793d3930 modified ciphertext xor keystream
What this does not claim
NOTE: toy unauthenticated XOR-mode illustration only; not AES internals, not nonce management, not a complete authenticated-encryption construction, and not production exploit guidance.
toy only = 1 \text{toy only}=1 toy only = 1
Unauthenticated change The target, attack mask, modified ciphertext, and decrypted result are recomputed. Target plaintext 48 bits / 6 bytes 0x7061793d3930 byte 0 byte 1 byte 2 byte 3 0 1 1 1 0 0 0 0 0 1 1 0 0 0 0 1 0 1 1 1 1 0 0 1 0 0 1 1 1 1 0 1 byte 4 byte 5 0 0 1 1 1 0 0 1 0 0 1 1 0 0 0 0 byte-0 0x70 byte-1 0x61 byte-2 0x79 byte-3 0x3d byte-4 0x39 byte-5 0x30 Attack mask 48 bits / 6 bytes 0x000000000800 byte 0 byte 1 byte 2 byte 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 byte 4 byte 5 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 byte-0 0x00 byte-1 0x00 byte-2 0x00 byte-3 0x00 byte-4 0x08 byte-5 0x00 Modified ciphertext 48 bits / 6 bytes 0x7f7f5401726a byte 0 byte 1 byte 2 byte 3 0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 1 byte 4 byte 5 0 1 1 1 0 0 1 0 0 1 1 0 1 0 1 0 byte-0 0x7f byte-1 0x7f byte-2 0x54 byte-3 0x01 byte-4 0x72 byte-5 0x6a Decrypted modified 48 bits / 6 bytes 0x7061793d3930 byte 0 byte 1 byte 2 byte 3 0 1 1 1 0 0 0 0 0 1 1 0 0 0 0 1 0 1 1 1 1 0 0 1 0 0 1 1 1 1 0 1 byte 4 byte 5 0 0 1 1 1 0 0 1 0 0 1 1 0 0 0 0 byte-0 0x70 byte-1 0x61 byte-2 0x79 byte-3 0x3d byte-4 0x39 byte-5 0x30 Toy bit flip rows - changed byte 4 row value check plaintext 7061793d3130 pinned bytes keystream 0f1e2d3c4b5a pinned bytes ciphertext 7f7f54017a6a plaintext xor keystream target plaintext 7061793d3930 attacker target attack mask 000000000800 plaintext xor target modified ciphertext 7f7f5401726a ciphertext xor mask decrypted modified 7061793d3930 modified ciphertext xor keystream
Summary
Without authentication, a controlled ciphertext change can control a plaintext byte in XOR-like modes.
authentication tag = 0 \text{authentication tag}=0 authentication tag = 0
Unauthenticated change The target, attack mask, modified ciphertext, and decrypted result are recomputed. Target plaintext 48 bits / 6 bytes 0x7061793d3930 byte 0 byte 1 byte 2 byte 3 0 1 1 1 0 0 0 0 0 1 1 0 0 0 0 1 0 1 1 1 1 0 0 1 0 0 1 1 1 1 0 1 byte 4 byte 5 0 0 1 1 1 0 0 1 0 0 1 1 0 0 0 0 byte-0 0x70 byte-1 0x61 byte-2 0x79 byte-3 0x3d byte-4 0x39 byte-5 0x30 Attack mask 48 bits / 6 bytes 0x000000000800 byte 0 byte 1 byte 2 byte 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 byte 4 byte 5 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 byte-0 0x00 byte-1 0x00 byte-2 0x00 byte-3 0x00 byte-4 0x08 byte-5 0x00 Modified ciphertext 48 bits / 6 bytes 0x7f7f5401726a byte 0 byte 1 byte 2 byte 3 0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 1 byte 4 byte 5 0 1 1 1 0 0 1 0 0 1 1 0 1 0 1 0 byte-0 0x7f byte-1 0x7f byte-2 0x54 byte-3 0x01 byte-4 0x72 byte-5 0x6a Decrypted modified 48 bits / 6 bytes 0x7061793d3930 byte 0 byte 1 byte 2 byte 3 0 1 1 1 0 0 0 0 0 1 1 0 0 0 0 1 0 1 1 1 1 0 0 1 0 0 1 1 1 1 0 1 byte 4 byte 5 0 0 1 1 1 0 0 1 0 0 1 1 0 0 0 0 byte-0 0x70 byte-1 0x61 byte-2 0x79 byte-3 0x3d byte-4 0x39 byte-5 0x30 Toy bit flip rows - changed byte 4 row value check plaintext 7061793d3130 pinned bytes keystream 0f1e2d3c4b5a pinned bytes ciphertext 7f7f54017a6a plaintext xor keystream target plaintext 7061793d3930 attacker target attack mask 000000000800 plaintext xor target modified ciphertext 7f7f5401726a ciphertext xor mask decrypted modified 7061793d3930 modified ciphertext xor keystream