We’ve recently had an interesting discussion at a local HPC Users Group meeting, on how (in theory) GPUs should be perfect for a range of cryptanalysis/cryptography applications. So last weekend I wrote a simple CUDA MD5 hash computation routine (based on RSA’s Md5.c source) to test it out in practice.
The results were pretty good, with speedups (when run on 8800 Ultra) of ~36x over a single core of a Q6700 Core Duo (or ~9x over all four cores, assuming linear scaling). This is a pretty nice gain for an unoptimized piece of code written in 1.5 days by a curious astrophysicist :-).
In absolute terms, the GPU was able to compute ~110 million MD5 hashes per second, while it was even faster (~160 Mhash/sec) when the results weren’t stored to global memory but instead compared against a “target” hash and discarded if no match was found (“search mode”). In laymen terms, this means a single 8800 Ultra can brute-force break an MD5 hashed password of eight or less alphanumerics+numbers (A-Z, a-z, 0-9) in about ~16 days. Kind of scary.
A short writeup, together with an exploration (and pretty plots!) of how the performance depends on the block size, number of blocks, threads, etc., can be found at http://majuric.org/software/cudamd5/. The source code is there as well. Feel free to download/use/modify it.
PS: If you download the code, I’d be especially interested to hear how it fares on other GPUs (especially the G92 series). Just run ‘make benchmark’, and e-mail me the results!