public static byte[] secureRandomBytes(int len){
  if (len <= 0) {
    len=1;
  }
  byte[] buff=new byte[len];
  SecureRandom sr=getSecureRandom();
synchronized (sr) {
    sr.nextBytes(buff);
  }
  return buff;
}

public static byte [ ] secureRandomBytes ( int len ) { if ( len <= 0 ) { len = 1 ; } byte [ ] buff = new byte [ len ] ; SecureRandom sr = getSecureRandom ( ) ; synchronized ( sr ) { sr . nextBytes ( buff ) ; } return buff ; }
get a number of cryptographically secure pseudo random bytes .
