Useful in many many cases.
Here is the code:

import java.security.SecureRandom;
import java.math.BigInteger;
 
final class randomstring
{
 
  static private SecureRandom rnd= new SecureRandom();
 
  static public String nextRandomString(int size)
  {
    return new BigInteger(130, rnd).toString(size);
  }
  public static void main(String args[])
  {
    System.out.println(nextRandomString(15));
 
    System.out.println(nextRandomString(32));
  }
 
}