News for hackers. Stuff that matters.
Re:The man who wrote the book on password management regrets... by e12e on Thursday August 10, 2017 @05:34AM (#14978004)
I'm not sure how big your word-list is, but my (wbritish) is:

  $ wc -l /usr/share/dict/words
  99156 /usr/share/dict/words
Sticking with Ruby:

  > Math.log(99156,2)*3
  => 49.79223735944021
That's some ways off from 54-bits, but you can bump it over 66 bits by using four words.

Second, from what I gather from [1],[2] and [3] - you should probably use SecureRandom for cryptographic/security purposes:

  $ ruby -e 'require "securerandom"; puts \
  File.read("/usr/share/dict/words").lines.sample(4, \
  random:SecureRandom).map(&:chomp).join(" ")'

  remorse's mountaineers said arrival's
[1] https://ruby-doc.org/core-2.4.1/Array.html#method-i-sample

[2] https://ruby-doc.org/core-2.4.1/Random.html

[3] https://ruby-doc.org/stdlib-2.4.1/libdoc/securerandom/rdoc/S...

There are no comments on this comment yet.