DBAbstract API Documentation

ro.raducora.utils.encryption.key
Class RC4EncryptionKey

java.lang.Object
  |
  +--ro.raducora.utils.encryption.key.StreamEncryptionKey
        |
        +--ro.raducora.utils.encryption.key.RC4EncryptionKey
All Implemented Interfaces:
java.lang.Cloneable

public class RC4EncryptionKey
extends StreamEncryptionKey

Author:
Radu Coravu

Constructor Summary
RC4EncryptionKey()
           
 
Method Summary
 byte[] decrypt(byte[] toDecrypt, int offset, int length)
          Decrypt.
 byte[] encrypt(byte[] toEncrypt, int offset, int length)
          Encrypt.
 boolean isExplicitlySet()
           
 void reset()
          Init Ciphers
 void setKey(java.lang.String key)
          Set the key.
 
Methods inherited from class ro.raducora.utils.encryption.key.StreamEncryptionKey
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RC4EncryptionKey

public RC4EncryptionKey()
Method Detail

reset

public void reset()
Init Ciphers

Specified by:
reset in class StreamEncryptionKey

setKey

public void setKey(java.lang.String key)
            throws java.security.InvalidKeyException
Set the key.

Specified by:
setKey in class StreamEncryptionKey
Parameters:
key - the String
java.security.InvalidKeyException

isExplicitlySet

public boolean isExplicitlySet()
Specified by:
isExplicitlySet in class StreamEncryptionKey
Returns:
true if key explicitly set.

encrypt

public byte[] encrypt(byte[] toEncrypt,
                      int offset,
                      int length)
Encrypt.

Specified by:
encrypt in class StreamEncryptionKey
Parameters:
toEncrypt - bytes to encrypt
offset - where to begin
length - how many bytes to process
Returns:
the encrypted array(could be different size than input because of padding)

decrypt

public byte[] decrypt(byte[] toDecrypt,
                      int offset,
                      int length)
Decrypt.

Specified by:
decrypt in class StreamEncryptionKey
Parameters:
toDecrypt - bytes to decrypt
offset - where to begin
length - how many bytes to process
Returns:
the decrypted array(could be different size than input because of padding removal)

DBAbstract API Documentation

© Copyright Radu Coravu 2002 - 2004.