org.koala.koalautil
Class Encryption

java.lang.Object
  |
  +--org.koala.koalautil.Encryption

public class Encryption
extends java.lang.Object

This class uses the api defined in JSE to encrypt/decrypt data. Currently it uses the Cryptix32 provider with 3DES


Constructor Summary
Encryption()
           
 
Method Summary
static java.lang.String decryptBytes(byte[] cipherTxt)
          decrypts an array of bytes
static java.lang.String decryptBytes(byte[] cipherTxt, java.lang.String algorithm, java.lang.String key)
          decrypts a chunk of data
static java.lang.String desencriptarString(java.lang.String txt)
           
static java.lang.String desencriptarString(java.lang.String txt, java.lang.String algorithm, java.lang.String key)
           
static byte[] encriptarABytes(java.lang.String txt)
           
static byte[] encriptarABytes(java.lang.String txt, java.lang.String algorithm, java.lang.String key)
          encrypts a message
static java.lang.String encriptarAString(java.lang.String txt)
           
static java.lang.String encriptarAString(java.lang.String txt, java.lang.String algorithm, java.lang.String key)
           
static java.lang.String hashString(java.lang.String txt)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Encryption

public Encryption()
Method Detail

decryptBytes

public static java.lang.String decryptBytes(byte[] cipherTxt)
                                     throws ChainedException
decrypts an array of bytes

Parameters:
cipherTxt -
Returns:
Throws:
ChainedException

decryptBytes

public static java.lang.String decryptBytes(byte[] cipherTxt,
                                            java.lang.String algorithm,
                                            java.lang.String key)
                                     throws ChainedException
decrypts a chunk of data

Parameters:
algorithm - the encryption algorythm to use
key - the encryption key
cipherTxt - the cyphertext
Returns:
the plaintext
Throws:
ChainedException - unspecified

encriptarABytes

public static byte[] encriptarABytes(java.lang.String txt)
                              throws ChainedException
Parameters:
txt -
Returns:
Throws:
ChainedException

encriptarABytes

public static byte[] encriptarABytes(java.lang.String txt,
                                     java.lang.String algorithm,
                                     java.lang.String key)
                              throws ChainedException
encrypts a message

Parameters:
algorithm - the encryption algorithm to use
key - the encryption's key
txt - plaintext
Returns:
cyphertext
Throws:
ChainedException - unspecified

encriptarAString

public static java.lang.String encriptarAString(java.lang.String txt)
                                         throws ChainedException
Parameters:
txt -
Returns:
Throws:
ChainedException

encriptarAString

public static java.lang.String encriptarAString(java.lang.String txt,
                                                java.lang.String algorithm,
                                                java.lang.String key)
                                         throws ChainedException
Parameters:
txt -
algorithm -
key -
Returns:
Throws:
ChainedException

desencriptarString

public static java.lang.String desencriptarString(java.lang.String txt)
                                           throws ChainedException
Parameters:
txt -
Returns:
Throws:
ChainedException

desencriptarString

public static java.lang.String desencriptarString(java.lang.String txt,
                                                  java.lang.String algorithm,
                                                  java.lang.String key)
                                           throws ChainedException
Parameters:
txt -
algorithm -
key -
Returns:
Throws:
ChainedException

hashString

public static java.lang.String hashString(java.lang.String txt)
                                   throws ChainedException
Parameters:
txt -
Returns:
Throws:
ChainedException