railo.runtime.crypt
Class BlowfishCBC

java.lang.Object
  extended by railo.runtime.crypt.BlowfishECB
      extended by railo.runtime.crypt.BlowfishCBC

public final class BlowfishCBC
extends BlowfishECB


Field Summary
 
Fields inherited from class railo.runtime.crypt.BlowfishECB
BLOCKSIZE, MAXKEYLENGTH
 
Constructor Summary
BlowfishCBC(byte[] bfkey)
          constructor, stores a zero CBC IV
BlowfishCBC(byte[] bfkey, byte[] initCBCIV)
          constructor
BlowfishCBC(byte[] bfkey, long lInitCBCIV)
          constructor
 
Method Summary
 void cleanUp()
          cleans up all critical internals, call this if you don't need an instance anymore
 void decrypt(byte[] buffer)
          decrypts a byte buffer (should be aligned to an 8 byte border) to itself
 void decrypt(byte[] inbuffer, byte[] outbuffer)
          decrypts a byte buffer (should be aligned to an 8 byte border) to another buffer (of the same size or bigger)
 void decrypt(int[] buffer)
          decrypts an int buffer (should be aligned to a two integer border)
 void decrypt(int[] inbuffer, int[] outbuffer)
          decrypts an integer buffer (should be aligned to an two integer border) to another int buffer (of the same size or bigger)
 void decrypt(long[] buffer)
          decrypts a long buffer to itself
 void decrypt(long[] inbuffer, long[] outbuffer)
          decrypts a long buffer to another long buffer (of the same size or bigger)
 void encrypt(byte[] buffer)
          encrypts a byte buffer (should be aligned to an 8 byte border) to itself
 void encrypt(byte[] inbuffer, byte[] outbuffer)
          encrypts a byte buffer (should be aligned to an 8 byte border) to another buffer (of the same size or bigger)
 void encrypt(int[] buffer)
          encrypts an integer buffer (should be aligned to an
 void encrypt(int[] inbuffer, int[] outbuffer)
          encrypts an int buffer (should be aligned to an two integer border) to another int buffer (of the same size or bigger)
 void encrypt(long[] buffer)
          encrypts a long buffer to itself
 void encrypt(long[] inbuffer, long[] outbuffer)
          encrypts a long buffer to another long buffer (of the same size or bigger)
 long getCBCIV()
          get the current CBC IV (for cipher resets)
 void getCBCIV(byte[] dest)
          get the current CBC IV (for cipher resets)
 void setCBCIV(byte[] newCBCIV)
          set the current CBC IV (for cipher resets)
 void setCBCIV(long lNewCBCIV)
          set the current CBC IV (for cipher resets)
 
Methods inherited from class railo.runtime.crypt.BlowfishECB
selfTest
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlowfishCBC

public BlowfishCBC(byte[] bfkey)
constructor, stores a zero CBC IV

Parameters:
bfkey - key material, up to MAXKEYLENGTH bytes

BlowfishCBC

public BlowfishCBC(byte[] bfkey,
                   long lInitCBCIV)
constructor

Parameters:
bfkey - key material, up to MAXKEYLENGTH bytes
lInitCBCIV - the CBC IV

BlowfishCBC

public BlowfishCBC(byte[] bfkey,
                   byte[] initCBCIV)
constructor

Parameters:
bfkey - key material, up to MAXKEYLENGTH bytes
lInitCBCIV - the CBC IV (array with min. BLOCKSIZE bytes)
Method Detail

getCBCIV

public long getCBCIV()
get the current CBC IV (for cipher resets)

Returns:
current CBC IV

getCBCIV

public void getCBCIV(byte[] dest)
get the current CBC IV (for cipher resets)

Parameters:
dest - wher eto put current CBC IV in network byte ordered array

setCBCIV

public void setCBCIV(long lNewCBCIV)
set the current CBC IV (for cipher resets)

Parameters:
lNewCBCIV - the new CBC IV

setCBCIV

public void setCBCIV(byte[] newCBCIV)
set the current CBC IV (for cipher resets)

Parameters:
newCBCIV - the new CBC IV in network byte ordered array

cleanUp

public void cleanUp()
cleans up all critical internals, call this if you don't need an instance anymore

Overrides:
cleanUp in class BlowfishECB

encrypt

public void encrypt(byte[] inbuffer,
                    byte[] outbuffer)
encrypts a byte buffer (should be aligned to an 8 byte border) to another buffer (of the same size or bigger)

Overrides:
encrypt in class BlowfishECB
Parameters:
inbuffer - buffer with plaintext data
outbuffer - buffer to get the ciphertext data

encrypt

public void encrypt(byte[] buffer)
encrypts a byte buffer (should be aligned to an 8 byte border) to itself

Overrides:
encrypt in class BlowfishECB
Parameters:
buffer - buffer to encrypt

encrypt

public void encrypt(int[] inbuffer,
                    int[] outbuffer)
encrypts an int buffer (should be aligned to an two integer border) to another int buffer (of the same size or bigger)

Overrides:
encrypt in class BlowfishECB
Parameters:
inbuffer - buffer with plaintext data
outBuffer - buffer to get the ciphertext data

encrypt

public void encrypt(int[] buffer)
encrypts an integer buffer (should be aligned to an

Overrides:
encrypt in class BlowfishECB
Parameters:
buffer - buffer to encrypt

encrypt

public void encrypt(long[] inbuffer,
                    long[] outbuffer)
encrypts a long buffer to another long buffer (of the same size or bigger)

Overrides:
encrypt in class BlowfishECB
Parameters:
inbuffer - buffer with plaintext data
outbuffer - buffer to get the ciphertext data

encrypt

public void encrypt(long[] buffer)
encrypts a long buffer to itself

Overrides:
encrypt in class BlowfishECB
Parameters:
buffer - buffer to encrypt

decrypt

public void decrypt(byte[] inbuffer,
                    byte[] outbuffer)
decrypts a byte buffer (should be aligned to an 8 byte border) to another buffer (of the same size or bigger)

Overrides:
decrypt in class BlowfishECB
Parameters:
inbuffer - buffer with ciphertext data
outBuffer - buffer to get the plaintext data

decrypt

public void decrypt(byte[] buffer)
decrypts a byte buffer (should be aligned to an 8 byte border) to itself

Overrides:
decrypt in class BlowfishECB
Parameters:
buffer - buffer to decrypt

decrypt

public void decrypt(int[] inbuffer,
                    int[] outbuffer)
decrypts an integer buffer (should be aligned to an two integer border) to another int buffer (of the same size or bigger)

Overrides:
decrypt in class BlowfishECB
Parameters:
inbuffer - buffer with ciphertext data
outbuffer - buffer to get the plaintext data

decrypt

public void decrypt(int[] buffer)
decrypts an int buffer (should be aligned to a two integer border)

Overrides:
decrypt in class BlowfishECB
Parameters:
buffer - buffer to decrypt

decrypt

public void decrypt(long[] inbuffer,
                    long[] outbuffer)
decrypts a long buffer to another long buffer (of the same size or bigger)

Overrides:
decrypt in class BlowfishECB
Parameters:
inbuffer - buffer with ciphertext data
outbuffer - buffer to get the plaintext data

decrypt

public void decrypt(long[] buffer)
decrypts a long buffer to itself

Overrides:
decrypt in class BlowfishECB
Parameters:
buffer - buffer to decrypt


Copyright © 2012 Railo