title: Generate secure random number uniformly over a range in Java
body: <p>How do I generate a <strong>secure uniform</strong> random number within a range? The range could be between 0 to 100. (The upper bound is not a power of 2).</p>
  
  <p><a href="http://docs.oracle.com/javase/7/docs/api/java/security/SecureRandom.html" rel="noreferrer"><code>java.security.SecureRandom</code></a> seems to provide the range <code>0..2^n</code>.</p>