Re: Setting an IV

Jan Luehe (Jan.Luehe@Eng)
Fri, 16 Jan 1998 15:46:39 -0800 (PST)

Date: Fri, 16 Jan 1998 15:46:39 -0800 (PST)
From: Jan Luehe <Jan.Luehe@Eng>
Subject: Re: Setting an IV
To: java-security@web1.javasoft.com, jonathan@oreilly.com

Jonathan:

> I'm a little bummed out about the method used in JCE 1.2
> to set the IV on a Cipher for decryption. As I see it,
> you have to construct a DESParameterSpec with the IV
> and pass the DESParameterSpec to the cipher when you
> initialize it for decryption. But this is a DES-specific solution.
>
> The implication is that if you want to use any cipher mode
> except ECB, you have to do something algorithm-specific.
> This bums me out--I want to be able to switch between
> two different algorithms, both in CBC or CFB mode, without
> changing my code. As it stands now, I'm out of luck, right?
>
> Maybe a generic IVParameterSpec interface would be
> appropriate? It could just have a method, getIV(), that
> returns the IV data.

I propose to simply rename "DESParameterSpec" (which already
implements the generic "AlgorithmParameterSpec" and provides
a "getIV" method) to "IvParameterSpec". "IvParameterSpec" could
be used for any cipher in feedback mode.

Jan