Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.credentialsstorage
Class AESCrypto

java.lang.Object
  extended by net.java.sip.communicator.impl.credentialsstorage.AESCrypto
All Implemented Interfaces:
Crypto

public class AESCrypto
extends Object
implements Crypto

Performs encryption and decryption of text using AES algorithm.

Author:
Dmitri Melnikov

Constructor Summary
AESCrypto(String masterPassword)
          Creates the encryption and decryption objects and the key.
 
Method Summary
 String decrypt(String ciphertext)
          Decrypts the cyphertext using the key.
 String encrypt(String plaintext)
          Encrypts the plaintext using the key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AESCrypto

public AESCrypto(String masterPassword)
Creates the encryption and decryption objects and the key.

Parameters:
masterPassword - used to derive the key. Can be null.
Method Detail

decrypt

public String decrypt(String ciphertext)
               throws CryptoException
Decrypts the cyphertext using the key.

Specified by:
decrypt in interface Crypto
Parameters:
ciphertext - base64 encoded encrypted data
Returns:
decrypted data
Throws:
CryptoException - when the ciphertext cannot be decrypted with the key or on decryption error.

encrypt

public String encrypt(String plaintext)
               throws CryptoException
Encrypts the plaintext using the key.

Specified by:
encrypt in interface Crypto
Parameters:
plaintext - data to be encrypted
Returns:
base64 encoded encrypted data
Throws:
CryptoException - on encryption error

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.