Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Ciphertext stealing
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
====CBC implementation notes==== For CBC ciphertext stealing, there is a clever (but opaque) method of implementing the described ciphertext stealing process using a standard CBC interface. Using this method imposes a performance penalty in the decryption stage of one extra block decryption operation over what would be necessary using a dedicated implementation. =====CBC ciphertext stealing encryption using a standard CBC interface===== # Pad the last partial plaintext block with 0. # Encrypt the whole padded plaintext using the standard CBC mode. # Swap the last two ciphertext blocks. # Truncate the ciphertext to the length of the original plaintext. [[Image:CipherText Stealing (CTS) on CBC, encryption mode.svg|center|CipherText Stealing (CTS) on CBC, encryption mode]] =====CBC ciphertext stealing decryption using a standard CBC interface===== # ''D''<sub>''n''</sub> = Decrypt (''K'', ''C''<sub>''n''β1</sub>). Decrypt the second-to-last ciphertext block using ECB mode. # ''C''<sub>''n''</sub> = ''C''<sub>''n''</sub> || Tail (''D''<sub>''n''</sub>, ''B''β''M''). Pad the ciphertext to the nearest multiple of the block size using the last ''B''β''M'' bits of block cipher decryption of the second-to-last ciphertext block. # Swap the last two ciphertext blocks. # Decrypt the (modified) ciphertext using the standard CBC mode. # Truncate the plaintext to the length of the original ciphertext. [[Image:CipherText Stealing (CTS) on CBC, decryption mode.svg|center|CipherText Stealing (CTS) on CBC, decryption mode]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)