Here you can find the source of generateKey(String password)
private static byte[] generateKey(String password) throws Throwable
//package com.java2s; //License from project: Open Source License import java.security.spec.KeySpec; import javax.crypto.SecretKeyFactory; import javax.crypto.spec.PBEKeySpec; public class Main { private final static byte[] salt = new byte[] { -30, -91, -71, 33, 41, 115, -89, 34, 115, 30, -42, -5, 18, -72, -106, -30 };/*from w w w . j a v a 2s. com*/ private static byte[] generateKey(String password) throws Throwable { KeySpec spec = new PBEKeySpec(password.toCharArray(), salt, 65536, 128); // AES-128 SecretKeyFactory f = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1"); return f.generateSecret(spec).getEncoded(); } }