I'm gonna use Ruby since it's the most readily available right now.
Combined with Ruby I'm gonna use the bcrypt
gem version 3.1.11
.
head -c 100M </dev/urandom > /tmp/100M
head -c 10M </dev/urandom > /tmp/10M
head -c 1M </dev/urandom > /tmp/1M
head -c 100k </dev/urandom > /tmp/100k
head -c 10k </dev/urandom > /tmp/10k
head -c 1k </dev/urandom > /tmp/1k
- Open the Rails console
- Read each file
x = File.read("/tmp/1G"); nil
(To prevent Rails from messing up your console) - Execute the benchmark
p Benchmark.measure { BCrypt::Password.create(x) }
- I'm running this in a Vagrant machine,
- Executed it only once,
- Didn't check other libraries, so it might be that slowness in another component dominates the computation time,
- Never used
Benchmark
for this kind of things before, so I might miss something here.
- Seems to be a bit to constant for me tbh
If and only if these values are accurate (please recheck them yourself!), the time required for BCrypt in Ruby seems to be dominated by something else than length. And in any way, it's still quite performant (only tested the single thread case here though).
- 2GB RAM Vagrant machine
- MacBook Pro (Retina, 15-inch, Mid 2015)
- 2,8 GHz Intel Core i7
- 16 GB 1600 MHz DDR3