Java tutorial
//package com.java2s; import javax.crypto.spec.SecretKeySpec; import java.security.Key; public class Main { private static final String ALGO = "AES"; private static final byte[] keyValue = "Ad0#2s!3oGyRq!5F".getBytes(); private static Key key; private static Key generateKey() throws Exception { if (key == null) key = new SecretKeySpec(keyValue, ALGO); return key; } }