Here you can find the source of generateKey()
private static Key generateKey()
//package com.java2s; /******************************************************************************* * Copyright (c) 2011, 2016 Eurotech and/or its affiliates and others * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors:/*w ww . j a va2 s . co m*/ * Eurotech - initial API and implementation * *******************************************************************************/ import java.security.Key; import javax.crypto.spec.SecretKeySpec; public class Main { private static final String ALGORITHM = "AES"; private static final byte[] SECRET_KEY = "ipsea1s214d5a6sfs8dfsdg@$%3saf".getBytes(); private static Key generateKey() { Key key = new SecretKeySpec(SECRET_KEY, ALGORITHM); return key; } }