Here you can find the source of generateKey()
private static Key generateKey() throws Exception
//package com.java2s; /**/*from ww w . j a v a 2 s. co m*/ * Copyright 2013 by PanicLauncher and Contributors * * This work is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License. * To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/. */ import java.security.Key; import javax.crypto.spec.SecretKeySpec; public class Main { private static Key generateKey() throws Exception { Key key = new SecretKeySpec("NotARandomKeyYes".getBytes(), "AES"); return key; } }