com.waveset.util
Class Encryptor

java.lang.Object
  extended bycom.waveset.util.Encryptor

public class Encryptor
extends java.lang.Object


Field Summary
static short blockSize
           
static java.lang.String code_id
           
static short KEY_SIZE
           
static short SALT_SIZE
           
 
Constructor Summary
Encryptor(byte[] key, java.lang.String cipher)
           
 
Method Summary
 void Decrypt3DES(byte[] buffer, int offset, int length)
           
 void DecryptDES(byte[] buffer, int offset, int length)
          Algorithm : DES ; Mode: ECB ; Padding: None
 void DecryptPBE(byte[] buffer, int offset, int length)
           
 void Encrypt3DES(byte[] buffer, int offset, int length)
           
 void EncryptDES(byte[] buffer, int offset, int length)
          Algorithm : DES ; Mode: ECB ; Padding: None
 void EncryptPBE(byte[] buffer, int offset, int origLength)
           
static byte[] generateKey(java.lang.String cipher)
           
static byte[] generateKey(java.lang.String cipher, java.lang.String rawPassword)
           
static byte[] generatePassCode(int size)
           
 void getDefaultKey(byte[] outKey)
           
 void setKey(byte[] inKey)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

code_id

public static final java.lang.String code_id
See Also:
Constant Field Values

blockSize

public static final short blockSize
See Also:
Constant Field Values

KEY_SIZE

public static final short KEY_SIZE
See Also:
Constant Field Values

SALT_SIZE

public static final short SALT_SIZE
See Also:
Constant Field Values
Constructor Detail

Encryptor

public Encryptor(byte[] key,
                 java.lang.String cipher)
          throws javax.crypto.NoSuchPaddingException,
                 java.security.InvalidKeyException,
                 java.security.NoSuchAlgorithmException,
                 WavesetException
Method Detail

Encrypt3DES

public void Encrypt3DES(byte[] buffer,
                        int offset,
                        int length)
                 throws java.lang.IllegalStateException,
                        javax.crypto.ShortBufferException,
                        javax.crypto.IllegalBlockSizeException,
                        javax.crypto.BadPaddingException
Throws:
java.lang.IllegalStateException
javax.crypto.ShortBufferException
javax.crypto.IllegalBlockSizeException
javax.crypto.BadPaddingException

EncryptDES

public void EncryptDES(byte[] buffer,
                       int offset,
                       int length)
                throws java.lang.IllegalStateException,
                       javax.crypto.ShortBufferException,
                       javax.crypto.IllegalBlockSizeException,
                       javax.crypto.BadPaddingException
Algorithm : DES ; Mode: ECB ; Padding: None

Throws:
java.lang.IllegalStateException
javax.crypto.ShortBufferException
javax.crypto.IllegalBlockSizeException
javax.crypto.BadPaddingException

Decrypt3DES

public void Decrypt3DES(byte[] buffer,
                        int offset,
                        int length)
                 throws java.lang.IllegalStateException,
                        javax.crypto.ShortBufferException,
                        javax.crypto.IllegalBlockSizeException,
                        javax.crypto.BadPaddingException
Throws:
java.lang.IllegalStateException
javax.crypto.ShortBufferException
javax.crypto.IllegalBlockSizeException
javax.crypto.BadPaddingException

EncryptPBE

public void EncryptPBE(byte[] buffer,
                       int offset,
                       int origLength)
                throws java.lang.IllegalStateException,
                       javax.crypto.ShortBufferException,
                       javax.crypto.IllegalBlockSizeException,
                       javax.crypto.BadPaddingException
Throws:
java.lang.IllegalStateException
javax.crypto.ShortBufferException
javax.crypto.IllegalBlockSizeException
javax.crypto.BadPaddingException

DecryptPBE

public void DecryptPBE(byte[] buffer,
                       int offset,
                       int length)
                throws java.lang.IllegalStateException,
                       javax.crypto.ShortBufferException,
                       javax.crypto.IllegalBlockSizeException,
                       javax.crypto.BadPaddingException
Throws:
java.lang.IllegalStateException
javax.crypto.ShortBufferException
javax.crypto.IllegalBlockSizeException
javax.crypto.BadPaddingException

DecryptDES

public void DecryptDES(byte[] buffer,
                       int offset,
                       int length)
                throws java.lang.IllegalStateException,
                       javax.crypto.ShortBufferException,
                       javax.crypto.IllegalBlockSizeException,
                       javax.crypto.BadPaddingException
Algorithm : DES ; Mode: ECB ; Padding: None

Throws:
java.lang.IllegalStateException
javax.crypto.ShortBufferException
javax.crypto.IllegalBlockSizeException
javax.crypto.BadPaddingException

getDefaultKey

public void getDefaultKey(byte[] outKey)

setKey

public void setKey(byte[] inKey)
            throws java.security.InvalidKeyException
Throws:
java.security.InvalidKeyException

generatePassCode

public static byte[] generatePassCode(int size)
                               throws WavesetException
Throws:
WavesetException

generateKey

public static byte[] generateKey(java.lang.String cipher)
                          throws WavesetException
Throws:
WavesetException

generateKey

public static byte[] generateKey(java.lang.String cipher,
                                 java.lang.String rawPassword)
                          throws WavesetException
Throws:
WavesetException