Android examples for java.security:AES
AES decrypt byte array with byte array key and return byte array
import javax.crypto.Cipher; import javax.crypto.spec.SecretKeySpec; public class Main { public static byte[] decrypt(byte[] key, byte[] input) throws Exception { Cipher cipher = Cipher.getInstance("AES"); cipher.init(Cipher.DECRYPT_MODE, new SecretKeySpec(key, "AES")); byte[] decrypted = cipher.doFinal(input); return decrypted; }/*from w w w. j av a2 s.co m*/ }