text: 
  def generateLargePrime(k):
       #k is the desired bit length
       r=100*(math.log(k,2)+1) #number of attempts max
       r_ = r
       while r>0:
          #randrange is mersenne twister and is completely deterministic
          #unusable for serious crypto purposes
           n = random.randrange(2**(k-1),2**(k))
           r-=1
           if isPrime(n) == True:
               return n
       return "Failure after "+`r_` + " tries."
  
  print generateLargePrime(1024)
  