|
Cryptix V3.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--xjava.security.IJCE_Traceable | +--xjava.security.Cipher | +--cryptix.provider.cipher.Blowfish
This class implements the Blowfish block cipher.
Blowfish was designed by Bruce Schneier. The algorithm is in the public domain.
References:
Copyright © 1997
Systemics Ltd on behalf of the
Cryptix Development Team.
All rights reserved.
$Revision: 1.8 $
Fields inherited from class xjava.security.Cipher |
DECRYPT,
ENCRYPT,
UNINITIALIZED |
Constructor Summary | |
Blowfish()
Constructs a Blowfish cipher object, in the UNINITIALIZED state. |
Method Summary | |
java.lang.Object |
clone()
Always throws a CloneNotSupportedException (cloning of ciphers is not supported for security reasons). |
protected int |
engineBlockSize()
SPI: Returns the length of an input block, in bytes. |
protected java.lang.Object |
engineGetParameter(java.lang.String param)
SPI: Gets the value of the specified algorithm parameter. |
protected void |
engineInitDecrypt(java.security.Key key)
SPI: Initializes this cipher for decryption, using the specified key. |
protected void |
engineInitEncrypt(java.security.Key key)
SPI: Initializes this cipher for encryption, using the specified key. |
protected void |
engineSetParameter(java.lang.String param,
java.lang.Object value)
SPI: Sets the specified algorithm parameter to the specified value. |
protected int |
engineUpdate(byte[] in,
int inOffset,
int inLen,
byte[] out,
int outOffset)
SPI: This is the main engine method for updating data. |
protected void |
finalize()
Cleans up resources used by this instance, if necessary. |
static LinkStatus |
getLinkStatus()
Gets an object representing the native linking status of this class. |
int |
getRounds()
Returns the currently set number of rounds for this instance. |
static void |
main(java.lang.String[] args)
Entry point for very basic self_test . |
void |
setRounds(int r)
Sets the number of rounds for this cipher. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public Blowfish()
We define a "rounds" property to allow running the algorithm in a number of rounds different than the default value; i.e. 16. Note however that there is not enough defined initial data for any number of rounds other than 16 for the time being.
Method Detail |
public static LinkStatus getLinkStatus()
protected final void finalize()
public final java.lang.Object clone() throws java.lang.CloneNotSupportedException
protected int engineBlockSize()
protected void engineInitEncrypt(java.security.Key key) throws java.security.InvalidKeyException, CryptixException
key
- the key to use for encryption.protected void engineInitDecrypt(java.security.Key key) throws java.security.InvalidKeyException, CryptixException
key
- the key to use for decryption.protected int engineUpdate(byte[] in, int inOffset, int inLen, byte[] out, int outOffset)
in and out may be the same array, and the input and output regions may overlap.
in
- the input data.inOffset
- the offset into in specifying where the data starts.inLen
- the length of the subarray.out
- the output array.outOffset
- the offset indicating where to start writing into
the out array.protected void engineSetParameter(java.lang.String param, java.lang.Object value) throws java.security.InvalidParameterException, InvalidParameterTypeException
Blowfish has a single parameter, "rounds", which specifies the number of rounds for this instance as a decimal String.
param
- the string name of the parameter.value
- the parameter value.protected java.lang.Object engineGetParameter(java.lang.String param)
Blowfish has a single parameter, "rounds", which specifies the number of rounds for this instance as a decimal String.
param
- the string name of the parameter.public void setRounds(int r)
If the specified number is invalid, an IllegalArgumentException is thrown.
Note that there is not enough defined initial data for any number of rounds other than 16 for the time being.
r
- the desired number of rounds for this cipher.public int getRounds()
public static void main(java.lang.String[] args)
self_test
.
|
Cryptix V3.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |