net.sourceforge.atunes.kernel.utils
Class CryptoUtils

java.lang.Object
  extended by net.sourceforge.atunes.kernel.utils.CryptoUtils

public class CryptoUtils
extends java.lang.Object

Utility methods for encrypting and decrypting

NOTE: This class does not not produce really secret encryptions (the secret key is public)!

.


Constructor Summary
CryptoUtils()
           
 
Method Summary
static byte[] decrypt(byte[] bytes)
          Decrypts a byte array.
static byte[] encrypt(byte[] bytes)
          Encrypts a byte array.
static void main(java.lang.String[] args)
          The main method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CryptoUtils

public CryptoUtils()
Method Detail

decrypt

public static byte[] decrypt(byte[] bytes)
                      throws java.security.GeneralSecurityException,
                             java.io.IOException
Decrypts a byte array.

Parameters:
bytes - The byte array to decrypt
Returns:
The decrypted byte array
Throws:
java.security.GeneralSecurityException - the general security exception
java.io.IOException - Signals that an I/O exception has occurred.

encrypt

public static byte[] encrypt(byte[] bytes)
                      throws java.security.GeneralSecurityException,
                             java.io.IOException
Encrypts a byte array.

Parameters:
bytes - The byte array to encrypt
Returns:
The encrypted byte array
Throws:
java.security.GeneralSecurityException - the general security exception
java.io.IOException - Signals that an I/O exception has occurred.

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
The main method.

Parameters:
args - the arguments
Throws:
java.lang.Exception - the exception


Copyright © 2006-2008 The aTunes Team. All Rights Reserved.