News for hackers. Stuff that matters.
Re:A journey to searching Have I Been Pwned database in 49μs by emmelaich on Sunday March 01, 2020 @06:08PM (#22460049)
Just to remind people of `look`, which does a binary search.

It might be superior to the articles methods if you only want to search for a few.

Re:A journey to searching Have I Been Pwned database in 49μs by xurukefi on Monday March 02, 2020 @06:55AM (#22463640)
Didn't know about look. Seems good enough (tested on a HDD):

    $ dd of=pwned-passwords-sha1-ordered-by-hash-v5.txt oflag=nocache conv=notrunc,fdatasync count=0
    0+0 records in
    0+0 records out
    0 bytes (0 B) copied, 9.5864e-05 s, 0.0 kB/s
    $ time look `sha1sum <(echo -n password) | tr [a-z] [A-Z] | cut -d" " -f1` pwned-passwords-sha1-ordered-by-hash-v5.txt
    5BAA61E4C9B93F3F0682250B6CF8331B7EE68FD8:3730471

    real    0m0.137s
    user    0m0.002s
    sys     0m0.013s
dd is used to drop the file from the fs cache. Something the author probably didn't do given the unrealistic 49μs. It's simply not possible to fetch data from a HDD that fast.
Re:A journey to searching Have I Been Pwned database in 49μs by stryku2393 on Monday March 02, 2020 @03:37PM (#22468664)
True, the benchmarks are bad. I'll rewrite them (to drop the cache every time) and update the results.
Re:A journey to searching Have I Been Pwned database in 49μs by iseeyou on Monday March 02, 2020 @09:52AM (#22464870)
wow, thanks, yet another tool to remember in the toolbox

  sudo purge
  time look E38AD214943DAAD1D64C102FAEC29DE4AFE9DA3D pwned-passwords-sha1-ordered-by-hash-v5.txt
  E38AD214943DAAD1D64C102FAEC29DE4AFE9DA3D:2413945
          0.01 real         0.00 user         0.00 sys`
not 49us, but fast enough for most use cases (purge should clear the fs cache)
Re:A journey to searching Have I Been Pwned database in 49μs by lolc on Monday March 02, 2020 @05:03AM (#22463086)
Funny how many tools are stowed on my system. I'll never know them all!