Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I\'ve just been skimming NIST\'s \"Five Confidentiality Modes\". I understand th

ID: 652940 • Letter: I

Question

I've just been skimming NIST's "Five Confidentiality Modes". I understand those block cipher modes are used to securely encrypt input longer that the block cipher length. However, the common block cipher modes all assume my input length is evenly divisible by my block cipher length.

What is a recommended way to deal with my non-block-cipher-length-divisible input to safely encrypt it? Are implementors prepadding it using data length? Or are there other common block cipher mode standards that deal with this?

Explanation / Answer

Actually, of the five modes listed in the document, three of them (CFB, OFB and CTR) do not make any assumptions that the plaintext is a multiple of the block length.

However, when we use CBC mode (which does make such an assumption), we generally do perform padding; that is, we generally do extend the plaintext out to a multiple of the block cipher length (there are other methods, such as "cipher text stealing", which avoid this -- for some reason, we don't see those techniques in practice). There are a number of ways to do such padding; PKCS #7 defines on commonly used method.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote