Here you can find the source of generateKey(byte[] seed)
public static byte[] generateKey(byte[] seed) throws Exception
//package com.java2s; //License from project: Open Source License import java.security.SecureRandom; import javax.crypto.KeyGenerator; import javax.crypto.SecretKey; public class Main { private static final String CIPHER_ALGORITHM = "AES"; private static final String RANDOM_GENERATOR_ALGORITHM = "SHA1PRNG"; private static final int RANDOM_KEY_SIZE = 128; public static byte[] generateKey(byte[] seed) throws Exception { KeyGenerator keyGenerator = KeyGenerator .getInstance(CIPHER_ALGORITHM); SecureRandom secureRandom = SecureRandom .getInstance(RANDOM_GENERATOR_ALGORITHM); secureRandom.setSeed(seed);/*w w w .j a v a2 s . com*/ keyGenerator.init(RANDOM_KEY_SIZE, secureRandom); SecretKey secretKey = keyGenerator.generateKey(); return secretKey.getEncoded(); } }