com.vodafone360.people.database.utils
Class EncryptionUtils

java.lang.Object
  extended by com.vodafone360.people.database.utils.EncryptionUtils

public class EncryptionUtils
extends java.lang.Object

EncryptionUtils... This is a utility class for credentials encrypting in database

Author:
-

Field Summary
private static java.lang.String ERROR_BADPADDING
          error definintions
private static java.lang.String ERROR_ILLEGALBLOCK
          error definintions
private static java.lang.String ERROR_INVALIDKEY
          error definintions
private static byte[] KEY_BYTES
          the hard coded key
private static javax.crypto.Cipher sCipher
          the Cipher
private static javax.crypto.spec.SecretKeySpec sKeySpec
          secret key
 
Constructor Summary
EncryptionUtils()
           
 
Method Summary
private static boolean createCipher()
          Creation of Cipher
static java.lang.String decryptPassword(byte[] passwordEn)
          Decryption of the password.
static byte[] encryptPassword(java.lang.String password)
          Encrypting the password.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sCipher

private static javax.crypto.Cipher sCipher
the Cipher


sKeySpec

private static javax.crypto.spec.SecretKeySpec sKeySpec
secret key


ERROR_INVALIDKEY

private static final java.lang.String ERROR_INVALIDKEY
error definintions

See Also:
Constant Field Values

ERROR_ILLEGALBLOCK

private static final java.lang.String ERROR_ILLEGALBLOCK
error definintions

See Also:
Constant Field Values

ERROR_BADPADDING

private static final java.lang.String ERROR_BADPADDING
error definintions

See Also:
Constant Field Values

KEY_BYTES

private static final byte[] KEY_BYTES
the hard coded key

Constructor Detail

EncryptionUtils

public EncryptionUtils()
Method Detail

encryptPassword

public static byte[] encryptPassword(java.lang.String password)
Encrypting the password.

Parameters:
password - string password
Returns:
byte array containing encrypted password, return NULL if supplied password Strind is NULL, or an exception is thrown.
Throws:
BadPaddingException.
IllegalBlockSizeException.
InvalidKeyException.

decryptPassword

public static java.lang.String decryptPassword(byte[] passwordEn)
Decryption of the password.

Parameters:
passwordEn - password in bytes
Returns:
string

createCipher

private static boolean createCipher()
Creation of Cipher

Returns:
true if cipher created otherwise false


JavaDoc