public static String decodeAES(String cipherMode, byte[] iv, byte[] data, byte[] keyValue) {
		String decryptedValue = null;

		try {
			Key key = new SecretKeySpec(keyValue, "AES");
			Cipher c = null;

			if (cipherMode.equalsIgnoreCase("cbc")) {

				c = Cipher.getInstance("AES/CBC/PKCS5Padding");
				c.init(Cipher.DECRYPT_MODE, key, new IvParameterSpec(iv));

			} else {

				c = Cipher.getInstance("AES/ECB/PKCS5Padding");
				c.init(Cipher.DECRYPT_MODE, key);

			}

			byte[] decValue = c.doFinal(data);
			decryptedValue = new String(decValue);

		} catch (NoSuchAlgorithmException e) {
			e.printStackTrace();
		} catch (NoSuchPaddingException e) {
			e.printStackTrace();
		} catch (InvalidKeyException e) {
			e.printStackTrace();
		} catch (IllegalBlockSizeException e) {
			e.printStackTrace();
		} catch (BadPaddingException e) {
			e.printStackTrace();
		} catch (InvalidAlgorithmParameterException e) {
			e.printStackTrace();
		}

		return decryptedValue;
	}