net.vattp.data
Class Encrypt3DES

java.lang.Object
  |
  +--net.vattp.data.MsgTransformer
        |
        +--net.vattp.data.Encrypt3DES

class Encrypt3DES
extends MsgTransformer

Implementation of triple DES-EDE encryption in Cypher Block Chaining mode.

Author:
Bill Frantz

Field Summary
private  DES myDes1
           
private  DES myDes2
           
private  DES myDes3
           
private  byte[] myDESKeys
           
private  boolean myIsStandardCBC
           
private  byte[] myIV
           
private  byte[] myPad
           
private  byte[] myPreviousBlock
           
 
Constructor Summary
(package private) Encrypt3DES(byte[] desKeys, byte[] iv, boolean isStandardCBC)
           
 
Method Summary
private static String eightToHex(byte[] b, int offset)
           
(package private)  byte[] getSuspendInfo()
          Get any information which will be required to resume a suspended connection.
private  void increment(byte[] value)
           
(package private)  void init()
          Initiate a transformation.
(package private)  void transform(byte[] buffer)
          Transform the data.
(package private)  void transform(byte[] buffer, int off, int len)
          Transform the data.
private  void xor(byte[] inOut, int offset, byte[] in)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myIV

private final byte[] myIV

myDESKeys

private final byte[] myDESKeys

myIsStandardCBC

private final boolean myIsStandardCBC

myPreviousBlock

private final byte[] myPreviousBlock

myPad

private final byte[] myPad

myDes1

private DES myDes1

myDes2

private DES myDes2

myDes3

private DES myDes3
Constructor Detail

Encrypt3DES

Encrypt3DES(byte[] desKeys,
            byte[] iv,
            boolean isStandardCBC)
Method Detail

init

void init()
Description copied from class: MsgTransformer
Initiate a transformation. This method must be called before the first transformation is called.

Specified by:
init in class MsgTransformer

getSuspendInfo

byte[] getSuspendInfo()
Description copied from class: MsgTransformer
Get any information which will be required to resume a suspended connection.

Specified by:
getSuspendInfo in class MsgTransformer

transform

void transform(byte[] buffer,
               int off,
               int len)
Description copied from class: MsgTransformer
Transform the data.

Specified by:
transform in class MsgTransformer
Parameters:
buffer - is the data to be transformed.
off - is the offset in buffer to start the transformation
len - is the length to transform.

xor

private void xor(byte[] inOut,
                 int offset,
                 byte[] in)

increment

private void increment(byte[] value)

eightToHex

private static String eightToHex(byte[] b,
                                 int offset)

transform

void transform(byte[] buffer)
Transform the data.

Parameters:
buffer - is the data to be transformed.


comments?