com.sshtools.j2ssh.transport.cipher
Class BlowfishCbc

java.lang.Object
  |
  +--com.sshtools.j2ssh.transport.cipher.BlowfishCbc
All Implemented Interfaces:
SshCipher

public class BlowfishCbc
extends java.lang.Object
implements SshCipher

This class is going to implement the blowfish-cbc encryption when I get around to doing it

Version:
1.0
Author:
Lee David Painter ( lee@sshtools.com )

Field Summary
protected static java.lang.String algorithmName
          The blowfish algorithm name for SSH
 
Fields inherited from interface com.sshtools.j2ssh.transport.cipher.SshCipher
DECRYPT_MODE, ENCRYPT_MODE
 
Constructor Summary
BlowfishCbc()
          Constructor for the BlowfishCbc object
 
Method Summary
 int getBlockSize()
          Gets the cipher block size
 void init(int mode, byte[] iv, byte[] keydata)
           Called to initate the cipher.
 byte[] transform(byte[] data)
           Transforms the data according to the cipher mode.
 byte[] transform(byte[] data, int offset, int len)
           Transforms the data according to the cipher mode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

algorithmName

protected static java.lang.String algorithmName
The blowfish algorithm name for SSH

Constructor Detail

BlowfishCbc

public BlowfishCbc()
Constructor for the BlowfishCbc object

Method Detail

init

public void init(int mode,
                 byte[] iv,
                 byte[] keydata)
          throws AlgorithmOperationException

Called to initate the cipher.

Specified by:
init in interface SshCipher
Parameters:
mode - ENCRYPT_MODE or DECRYPT_MODE
iv - The initialization vector data
keydata - The key data
Throws:
AlgorithmOperationException - Thrown if a provider cannot be found for the cipher

transform

public byte[] transform(byte[] data)
                 throws AlgorithmOperationException

Transforms the data according to the cipher mode.

Specified by:
transform in interface SshCipher
Parameters:
data - The untransformed data
Returns:
The transformed data
Throws:
AlgorithmOperationException - Thrown if an error occurs

transform

public byte[] transform(byte[] data,
                        int offset,
                        int len)
                 throws AlgorithmOperationException

Transforms the data according to the cipher mode.

Specified by:
transform in interface SshCipher
Parameters:
data - The untransformed data
offset - The offset to start from in the untransformed data
len - The length of data to transform
Returns:
The transformed data
Throws:
AlgorithmOperationException - Thrown if an error occurs

getBlockSize

public int getBlockSize()
Gets the cipher block size

Specified by:
getBlockSize in interface SshCipher
Returns:
The blockSize value


Copyright © 2002 Sshtools.com. All Rights Reserved.