Jim Gillogly (jim@mentat.com)
Thu, 9 Apr 98 20:14:58 PDT
Bram asks:
> I'm implementing CBC mode now, and would like to use ciphertext stealing,
> ...
> There is, however, a problem - what to do with messages
> which are shorter than the block size? I can't figure out a way of
> encrypting them. Does anyone know if it's possible to encrypt messages
> that small and still have an output the same size as the input? If not,
> does anyone have any suggestions about how to handle it?
This is off the top of my head, but how about using a hash of the key
concatenated with the message number as the data for this short first
block, encrypting it with your block cipher, and XORing the few bytes
of plaintext with the ciphertext output? You need the message number
or some other non-repeating information to avoid giving the attacker
"depth"; including the key in the hash prevents a known plaintext
attack.
Jim Gillogly
The following archive was created by hippie-mail 7.98617-22 on Fri Aug 21 1998 - 17:16:56 ADT