This program in C++ allows you to generate a rainbow table and crack passwords hashed in SHA256.
For academic reasons :
- passwords are NOT salted;
- passwords are stored after a single pass through the hash function;
- passwords are alphanumeric (lowercase, uppercase and number);
- passwords have at least 6 and at most 10 characters.
- Luyckx Marco:496283
- Vincent Vanmuysewinkel:489399
- Alexis Picquet:464559
- Caner Korkut:396772
To fetch the project from GitLab, run the following command :
$ git clone https://gitlab.com/maluyckx/ssd_ws_rainbow.git
We have provided a makefile that simplifies the build process. Move into the correct directory and use the make command :
$ cd code
$ make rainbow
You can use the program in three different ways :
- Generate a rainbow table depending on parameters (Generate)
- Trying to find passwords from their hashes using a rainbow table (Attack)
- Both (Both)
To generate a rainbow table, use the following command :
./rainbow G <n> <l> <rt>where :
<n>= the number of passwords that you want to generate<l>= the length of these passwords (we recommend between 6 and 10)<rt>= name of the file where the output rainbow table should be stored (recommend using a .rt)
To perform an attack on hashes using a rainbow table, use the following command :
./rainbow A <rt> <hashes>where :
<rt>= a binary file generated by the command above ("pwds.rt")<hashes>= a plaintext file containing one hash on each line
To perform both operations, use the following command :
./rainbow B <n> <l> <hashes>where :
<n>= the number of passwords that you want to generate<l>= the length of these passwords (we recommend between 6 and 10)<hashes>= a plaintext file containing one hash on each line
Marco's config (laptop): AMD Ryzen 5 3550H with Radeon Vega Mobile Gfx Core speeds (MHz): 1: 1305 2: 1266 3: 1228 4: 1243 5: 1223 6: 1226 7: 1223 8: 1221
Generation
The generation times for various password lengths with 50,000 passes are as follows :
| Length | Time (sec) |
|---|---|
| 10 000 | 55.704s |
| 100 000 | 552.988s |
| 500 000 | 2796.256s |
| 1 000 000 | 5687.98s |
The length of the passwords does not significantly affect the generation time.
Recommendations as to the number of rows to have in the rainbow tables to have optimal chances to crack passwords (can't guarantee it'll be on time with the generation requirements though).
| Table length | 6 | 7 | 8 | 9 | 10 |
|---|---|---|---|---|---|
| Recommended number of passwords |
300.000 | 2.100.000 | 15.500.000 | 120.000.000 | 920.000.000 (probably too long for our implementation) |
| Approximate odds | 50% | 50% | 50% | 50% | 50% |