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 decryption steps==== # ''D''<sub>''n''</sub> = Decrypt (''K'', ''C''<sub>''n''β1</sub>). Decrypt ''C''<sub>''n''β1</sub> to create ''D''<sub>''n''</sub>. This undoes step 6 of the encryption process. # ''C'' = ''C''<sub>''n''</sub> || 0<sup>''B''β''M''</sup>. Pad ''C''<sub>''n''</sub> with zeros at the end to create a block ''C'' of length ''B''. We are padding ''C''<sub>''n''</sub> with zeros to help in step 3. # ''X''<sub>''n''</sub> = ''D''<sub>''n''</sub> XOR ''C''. Exclusive-OR ''D''<sub>''n''</sub> with ''C'' to create ''X''<sub>''n''</sub>. Looking at the first ''M'' bits, this step has the result of XORing ''C''<sub>''n''</sub> (the first ''M'' bits of the encryption process' ''E''<sub>''n''β1</sub>) with the (now decrypted) ''P''<sub>''n''</sub> XOR Head (''E''<sub>''n''β1</sub>, ''M'') (see steps 4-5 of the encryption process). In other words, we have CBC decrypted the first ''M'' bits of ''P''<sub>''n''</sub>. Looking at the last ''B''β''M'' bits, this recovers the last ''B''β''M'' bits of ''E''<sub>''n''β1</sub>. # ''P''<sub>''n''</sub> = Head (''X''<sub>''n''</sub>, ''M''). Select the first ''M'' bits of ''X''<sub>''n''</sub> to create ''P''<sub>''n''</sub>. As described in step 3, the first ''M'' bits of ''X''<sub>''n''</sub> contain ''P''<sub>''n''</sub>. We queue this last (possibly partial) block for eventual output. # ''E''<sub>''n''β1</sub> = ''C''<sub>''n''</sub> || Tail (''X''<sub>''n''</sub>, ''B''β''M''). Append the tail (''B''β''M'') bits of ''X''<sub>''n''</sub> to ''C''<sub>''n''</sub> to create ''E''<sub>''n''β1</sub>. As described in step 3, ''E''<sub>''n''β1</sub> is composed of all of ''C''<sub>''n''</sub> (which is ''M'' bits long) appended with the last ''B''β''M'' bits of ''X''<sub>''n''</sub>. We reassemble ''E''<sub>''n''β1</sub> (which is the same ''E''<sub>''n''β1</sub> seen in the encryption process) for processing in step 6. # ''X''<sub>''n''β1</sub> = Decrypt (''K'', ''E''<sub>''n''β1</sub>). Decrypt ''E''<sub>''n''β1</sub> to create ''X''<sub>''n''β1</sub>. This reverses encryption step 2. ''X''<sub>''n''β1</sub> is the same as in the encryption process. # ''P''<sub>''n''β1</sub> = ''X''<sub>''n''β1</sub> XOR ''C''<sub>''n''β2</sub>. Exclusive-OR ''X''<sub>''n''β1</sub> with the previous ciphertext block, ''C''<sub>''n''β2</sub>, to create ''P''<sub>''n''β1</sub>. Finally, we reverse the XOR step from step 1 of the encryption process.
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)