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)

    Literature exists at the same time in the modes of error and truth; it both betrays and obeys its own mode of being.
    Paul Deman (1919–1983)

    I was here first introduced to Joe.... He was a good-looking Indian, twenty-four years old, apparently of unmixed blood, short and stout, with a broad face and reddish complexion, and eyes, methinks, narrower and more turned up at the outer corners than ours, answering to the description of his race. Besides his underclothing, he wore a red flannel shirt, woolen pants, and a black Kossuth hat, the ordinary dress of the lumberman, and, to a considerable extent, of the Penobscot Indian.
    Henry David Thoreau (1817–1862)