title: Difference between BigInteger.probablePrime() and other primality algorithms in java
body: <p>I am implementing an RSA encryption program using Java. Right now I am using   <code>BigInteger.probablePrime(1024, rnd)</code> to get prime numbers.  Here <code>rnd</code> is a random number generated by <code>Random rnd = new Random()</code> . 
  I need to test various speeds of encryption.</p>
  
  <p>My questions are:</p>
  
  <ol>
  <li><p>what algorithm does the <code>BigInteger.probablePrime(1024, rnd)</code> use? </p></li>
  <li><p>what is the difference between the algorithm above and other algorithms:  like Rabin-Miller, Fermats, Lucas-Lehmer? </p></li>
  </ol>
  
  <p>Thank you.</p>