org.rivetlogic.scar.crypto
Class SimpleAesCipher

java.lang.Object
  extended by org.rivetlogic.scar.crypto.SimpleAesCipher

public class SimpleAesCipher
extends java.lang.Object

A simple AES-based symmetric cipher

Author:
Rivet Logic Corporation

Constructor Summary
SimpleAesCipher(java.lang.String base64Key)
           
 
Method Summary
 byte[] decrypt(byte[] encrypted)
           
 byte[] encrypt(byte[] clear)
           
 void setKey(byte[] key)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleAesCipher

public SimpleAesCipher(java.lang.String base64Key)
Method Detail

setKey

public void setKey(byte[] key)

encrypt

public byte[] encrypt(byte[] clear)
               throws java.security.InvalidKeyException,
                      javax.crypto.IllegalBlockSizeException,
                      javax.crypto.BadPaddingException
Throws:
java.security.InvalidKeyException
javax.crypto.IllegalBlockSizeException
javax.crypto.BadPaddingException

decrypt

public byte[] decrypt(byte[] encrypted)
               throws java.security.InvalidKeyException,
                      javax.crypto.IllegalBlockSizeException,
                      javax.crypto.BadPaddingException
Throws:
java.security.InvalidKeyException
javax.crypto.IllegalBlockSizeException
javax.crypto.BadPaddingException


Copyright 2008, Rivet Logic Corporation.