title: Generate secure random number with SecureRandom
body: <p>How can I generate a <strong>6</strong> digit integer using <code>SecureRandom</code> class of Java? </p>
  
  <p>I am trying the following code to generate random numbers :</p>
  
  <pre><code>SecureRandom secureRandom = new SecureRandom();
  int secureNumber = secureRandom.nextInt();
  </code></pre>
  
  <p>It is generating random numbers with any length including negative number. I don't find any method in <code>SecureRandom</code> class to provide a range of numbers. I want to generate a <strong>6</strong> digits <em>positive</em> random number</p>