Skip to content
<- all work
SystemsMar 2025·CSDP 610, Parallel Computing

GPU Acceleration for Cryptanalysis

AES-128 key search, CUDA against OpenMP, measured

A direct measurement of what wide parallelism does to brute-force cryptanalysis. The same AES-128 key search was written twice, once with OpenMP across 8 CPU threads and once in CUDA across 40,960 threads, then run over a 4.29 billion key space. CUDA finished in 123.5 seconds against OpenMP's 3,928, a 32x gap on a laptop GTX 1050.

Results

32x
Speedup
CUDA over OpenMP
123.5s
GPU runtime
against 3,928s on CPU
4.29B
Key space searched
0x0 to 0xffffffff
34.8M
Keys / second
against 1.09M on CPU

01Setup

Both versions search for a known key across an exhaustive space, so the comparison isolates the parallel architecture instead of rewarding a smarter algorithm. The OpenMP build used 8 threads on an Intel i5-8300H. The CUDA build used 160 blocks of 256 threads on an NVIDIA GTX 1050. Neither side is serious hardware, which is part of the point.

02Results

Over the 32-bit space, CUDA held roughly 34.8 million keys per second against the CPU's 1.09 million. Widening to a 36-bit space of 68.7 billion keys kept the ratio: 32.3 minutes on the GPU, an estimated 41.6 hours on the CPU.

The takeaway is about cost, not about cryptography. Consumer GPU parallelism moves brute force from impossible to merely expensive at key lengths that looked safe under CPU assumptions. Key length is still the defense. The constant factor sitting in front of it has moved by more than an order of magnitude.