Android examples for java.security:AES
AES encrypt byte array
//package com.java2s; import javax.crypto.Cipher; import javax.crypto.spec.SecretKeySpec; public class Main { private static byte[] encrypt(byte[] key, byte[] src) throws Exception { SecretKeySpec skeySpec = new SecretKeySpec(key, "AES"); Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding"); cipher.init(Cipher.ENCRYPT_MODE, skeySpec); return cipher.doFinal(src); }// w ww .java2 s. c o m }