Here you can find the source of randomKey()
public final static String randomKey()
//package com.java2s; //License from project: Open Source License public class Main { public final static String randomKey() { byte[] key = new byte[16]; for (int i = 0; i < 16; i++) { key[i] = (byte) (-128 + (int) (Math.random() * ((127 - -128) + 1))); }/*from w ww . j ava2 s . c om*/ return new String(key); } }