4 ms·
bcrypt: 21kH/s scrypt: 750kH/s The author didn't mention the work factor so I don't know how comparable the results are. But I thought the merit of scrypt over
by cm2187 9y ago
bcrypt: 21kH/s scrypt: 750kH/s
The author didn't mention the work factor so I don't know how comparable the results are. But I thought the merit of scrypt over bcrypt was that it was memory hard, i.e. hard to run on a GPU. It doesn't seem to be the case.
- mrb 9y agoThe thing about bcrypt is that despite using small data structures in memory (kilobytes) it reads and writes and rewrites a lot of data into them (megabytes, when choosing common work factors). And the small size of its data structures is still just a bit too big to fit many parallel instances of bcrypt in GPU L2 caches. So it is effectively "memory hard" on GPUs. Contrast this with scrypt which writes memory (typically megabytes) only once, and a byte is read, on average, only once. bcrypt and scrypt are both, at the moment, memory hard on GPU, but for different reasons. bcrypt reads/writes many times a small buffer. scrypt reads/writes once a large buffer. Don't pay too much importance on comparing the hash/sec of these 2 algorithms in this specific benchmark. The configurable work factors influence speed a lot. One day L2 caches will be big enough and we will see a sudden massive cracking speed improvement for bcrypt. This isn't going to happen anytime soon for scrypt.
- nly 9y agoSo one is memory capacity bound, and one is memory bandwidth bound.
- valarauca1 9y agoThe notion of scrypt being "memory hard" is from 2009. This is when GPU just started supporting 1GiB of RAM [1] 256MiB and 512MiB models were still common place. The 1080Ti supports 11x that [2] its a far cry to buy a GPU that doesn't support at least 4GiB. Scrypt difficult is 128 bytes × N_cost×r_blockSizeFactor [3]. The "standard" parameters 16384 = N blocksize = 8 results in 16MiB of memory per instance. On a 512MiB GPU that was only 32 instances in parallel. A modern 1080Ti (with 11GiB) that can be 704 instances. Now we're cooking with gas. Moore's Law it happens. [1] http://www.anandtech.com/show/2744/2 http://www.anandtech.com/show/2744/2 [2] https://www.evga.com/products/productlist.aspx?type=0&family=GeForce+10+Series+Family&chipset=GTX+1080+Ti https://www.evga.com/products/productlist.aspx?type=0&family... [3] https://stackoverflow.com/questions/11126315/what-are-optimal-scrypt-work-factors https://stackoverflow.com/questions/11126315/what-are-optima...
- FullyFunctional 9y agoThat's because scrypt is using the wrong memory hardness. The really hard problem in reality is memory load latency (assuming a large memory with random access). We essentially haven't made much progress on that font in decade(s), but have tapered over it with ever increasing levels of cache. If the access is effectively random, then the caches won't help. Base the crypto on that!
- masklinn 9y ago> The author didn't mention the work factor It's not really the author, it's the Hashcat benchmark which they've just straight run onto the system, there's the exact same problem with e.g. PBKDF2: Hashtype: PBKDF2-HMAC-SHA256 […] Speed.Dev.#*…..: 14417.6 kH/s Hashtype: Django (PBKDF2-SHA256) […] Speed.Dev.#*…..: 729.6 kH/s or Hashtype: PBKDF2-HMAC-SHA512 […] Speed.Dev.#*…..: 4974.7 kH/s Hashtype: OSX v10.8+ […] Speed.Dev.#*…..: 147.2 kH/s (it's my understanding that current OSX uses PBKDF2-SHA512)
- nly 9y agoI wonder what the numbers are for Argon2