1 to B, inclusive, so Pn could possibly be a complete block. The CBC mode description also makes use of the ciphertext block just previous to the blocks concerned, Cn−2, which may in fact be the IV if the plaintext fits within two blocks. For this description, the following functions and operators are used: Head (data, a): returns the first a bits of the 'data' string. Tail (data, a): returns the last a bits of the 'data' string. Encrypt (K, data): use the underlying block cipher in encrypt mode on the 'data' string using the key K. Decrypt (K, data): use the underlying block cipher in decrypt mode on the 'data' string using the key K. XOR: Bitwise Exclusive-OR. Equivalent to bitwise addition without use of a carry bit. ||: Concatenation operator. Combine the strings on either side of the operator. 0a: a string of a 0 bits. ECB ciphertext stealing Ciphertext stealing in ECB mode introduces an inter-block dependency within the last two blocks, resulting in altered error propagation behavior for the last two blocks. ECB encryption steps (see figure) En−1 = Encrypt (K, Pn−1). Encrypt Pn−1 to create En−1. This is equivalent to the behavior of standard ECB mode. Cn = Head (En−1, M). Select the first M bits of En−1 to create Cn. The final ciphertext block, Cn, is composed of the leading M bits of the second-to-last ciphertext block. In all cases, the last two blocks are sent in a different order than the corresponding plaintext blocks. Dn = Pn || Tail (En−1, B−M). Pad Pn with the low order bits from En−1. Cn−1 = Encrypt (K, Dn). Encrypt Dn to create Cn−1. For the first M bits, this is equivalent to what would happen in ECB mode (other than the ciphertext ordering). For the last B−M bits, this is the second time that these data have been encrypted under this key (It was already encrypted in the production of En−1 in step 2). ECB decryption steps Dn = Decrypt (K, Cn−1). Decrypt Cn−1 to create Dn. This undoes step 4 of the encryption process. En−1 = Cn || Tail (Dn, B−M). Pad Cn with the extracted ciphertext in the tail end of Dn (placed there in step 3 of the ECB encryption process). Pn = Head (Dn, M). Select the first M bits of Dn to create Pn. As described in step 3 of the