Extension of the project for the Accelerated Computing Systems course at the Master's degree in Computer Engineering, University of Bologna. Parallel application for password cracking through Brute Force attack on SHA-256 hashes (including salted) and dictionary attack, leveraging the parallelism provided by HPC systems and the OpenMP library.
This repository contains the OpenMP implementation of a password cracker to reverse SHA-256 hashes. It supports Brute Force attacks and dictionary attacks, including salt support. The goal is to show how to redesign the parallelism strategy by moving from millions of lightweight threads (CUDA) to a limited number of more powerful CPU threads (OpenMP), preserving correctness and achieving good speedups on multi-core systems.
- Brute Force: search-space partitioning by first character (dynamic scheduling strategies).
- Dictionary Attack: efficient in-memory loading and parallel word processing.
- Salted Hashes Support: salt handling as prefix/suffix in verifications.
- Early Exit: shared volatile flag for early termination when password is found.
- Test / SLURM scripts: templates to run scalability tests on clusters (G100).
kernel_omp.cpp— main OpenMP kernel (brute force).kernel_omp_estensione.cpp— version with salt & dictionary.ESTENSIONE/— specific code for hybrid attacks (dictionary + salt).UTILS/— utility functions (I/O, argument parsing, charset loader).ASSETS/— charset, wordlists (e.g., CharSet.txt, rockyou_trimmed.txt).
- Hardware: Multi-core CPU
- Software:
- g++ with OpenMP support (GCC / Clang).
- OpenSSL (for <openssl/sha.h>).
Make sure OpenSSL libraries are linked correctly.
g++ -fopenmp -O3 kernel_omp.cpp sequenziale.cpp UTILS/utils.cpp -o bruteforce_omp -lssl -lcrypto(change file names and dependencies based on the version to compile)
If your system is not managed by a job scheduler, you can directly run the compiled file:
./bruteforce_estensione_omp <hash_target> <min_len> <max_len> <file_charset> [<use_dictionary(yes/no)> <dictionary_file>] (example with extended version with salt and dictionary)
Otherwise, it is necessary to schedule execution through a scheduler (such as SLURM):
sbatch ./launcher.sh