Ciphertext Stealing - Ciphertext Stealing Mode Description

Ciphertext Stealing Mode Description

In order to encrypt or decrypt data, use the standard block cipher mode of operation on all but the last two blocks of data.

The following steps describe how to handle the last two blocks of the plaintext, called Pn−1 and Pn, where the length of Pn−1 equals the block size of the cipher in bits, B, the length of the last block, Pn, is M bits, and K is the key that is in use. M can range from 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.

Read more about this topic:  Ciphertext Stealing

Famous quotes containing the words stealing, mode and/or description:

    In yonder Grave a Druid lies
    Where slowly winds the Stealing Wave!
    The Year’s best Sweets shall duteous rise
    To deck its Poet’s sylvan Grave!
    William Collins (1721–1759)

    The mode of founding a college is, commonly, to get up a subscription of dollars and cents, and then, following blindly the principles of a division of labor to its extreme,—a principle which should never be followed but with circumspection,—to call in a contractor who makes this a subject of speculation,... and for these oversights successive generations have to pay.
    Henry David Thoreau (1817–1862)

    I fancy it must be the quantity of animal food eaten by the English which renders their character insusceptible of civilisation. I suspect it is in their kitchens and not in their churches that their reformation must be worked, and that Missionaries of that description from [France] would avail more than those who should endeavor to tame them by precepts of religion or philosophy.
    Thomas Jefferson (1743–1826)