Android examples for java.security:AES
get New AES Key
//package com.java2s; import javax.crypto.KeyGenerator; import javax.crypto.SecretKey; public class Main { public static byte[] getNewAESKey() throws Exception { KeyGenerator keyGen = KeyGenerator.getInstance("AES"); keyGen.init(256); // for example SecretKey secretKey = keyGen.generateKey(); return secretKey.getEncoded(); }//from w w w .ja v a 2 s . com }