Java tutorial
//package com.java2s; import java.math.BigInteger; import java.security.SecureRandom; public class Main { private static SecureRandom random = new SecureRandom(); public static String genRandomString(int length) { BigInteger bi = new BigInteger(130, random); return bi.toString(32); } }