On Sun, Feb 27, 2000 at 11:36:17PM +1100, Damien Miller wrote:
> What risks does using a predictable IV bring?
> Background: I am interested in writing an encrypting swap driver for
> Linux using a fast cipher in CBC mode keyed from /dev/random at boot
> time.

If you just use the block number, there are vulnerabilities when you try
to encrypt data of a form like this:

block 0: 0x123456789abcdef0
block 1: 0x123456789abcdef1

XOR with the block number and you get the same input and output. Anyone
who knows what block 0 is can easily figure out what block 1 is, and
vice versa. I'm not sure what else can be done with this.

The bottom line is that IVs should be random or pseudo-random so that
these things can only occur by random chance. Related IVs are bad
because they are more likely to coincide with structure in the
plaintext.

You should probably do what Matt Blaze did for CFS. ECB-encrypt the
block number under one key (which should be secret but I don't think
needs to be), XOR the plaintext with that, then ECB-encrypt the result
with your secret key. This requires two block encryption operations
instead of one but at least you're doing something that has stood up to
some analysis.

Reply via email to