public static byte[] generateKey() {
        CipherKeyGenerator cipherKeyGenerator = new CipherKeyGenerator();
        cipherKeyGenerator.init(new KeyGenerationParameters(new SecureRandom(), 128));
        return cipherKeyGenerator.generateKey();
    }
public static byte [ ] generateKey ( ) { CipherKeyGenerator cipherKeyGenerator = new CipherKeyGenerator ( ) ; cipherKeyGenerator . init ( new KeyGenerationParameters ( new SecureRandom ( ) , 128 ) ) ; return cipherKeyGenerator . generateKey ( ) ; }
Generates a 128-bit key (16 bytes) randomly for RC4 encryption/decryption.

@return generated key bytes