title: How do I use boost::random_device to generate a cryptographically secure 64 bit integer?
body: <p>I would like to do something like this:</p>
  
  <pre><code>boost::random_device rd;
  boost::random::mt19937_64 gen(rd());
  boost::random::uniform_int_distribution&lt;unsigned long long&gt; dis;
  uint64_t value = dis(gen);
  </code></pre>
  
  <p>But I've read that a mersenne twister is not cryptographically secure. However, I've also read that a random_device could be, if its pulling data from /dev/urandom which is likely on a linux platform (my main platform). So if the random_device is non-deterministically random and its used to seed the mersenne twister (as shown above), doesn't that also make the mersenne twister cryptographically secure (even though by itself, it isn't)?</p>
  
  <p>I'm a bit of a novice in this arena so any advice is appreciated. </p>
  
  <p>So, how can I generate a cryptographically secure 64 bit number that can be stored in a uint64_t?</p>
  
  <p>Thanks,</p>
  
  <p>Ben.</p>