xjava.security
Interface FeedbackCipher
- CBC, CFB, CFB_PGP, FeedbackMode, OFB, PCBC
public interface FeedbackCipher
An interface implemented by algorithms that use feedback. Examples
include block ciphers in
CBC
,
CFB
, or
OFB
mode.
This interface is used to set or get the initialization vector,
which is the data first used as feedback.
Note that initialization vectors are not secret, and should not
be used for data (such as cipher keys) where secrecy is required.
getInitializationVector
public byte[] getInitializationVector()
Gets the initialization vector for this object. This may be
called on a cipher implementing FeedbackCipher. It will return
null
if the initialization vector has not been set.
- the initialization vector for this cipher object.
getInitializationVectorLength
public int getInitializationVectorLength()
Returns the size of the initialization vector expected by
setInitializationVector
.
- the required size of the argument to
setInitializationVector
.
setInitializationVector
public void setInitializationVector(iv[] )
Sets the initialization vector for this object. Note that
FeedbackCiphers will usually default to a randomly generated
vector if none is provided.
This method may only be called on an uninitialized cipher
(one in the
UNINITIALIZED
state) that implements
FeedbackCipher.