Rating:
There are 1001 hashes in the hashes.txt, password is exactly 6 lowercase letters and the seed is lower then 10000 (this hint has been added later, otherwise it could be very hard to solve with possible 64-bit seed).
Because of speed I've decided to implement it in C++
* XXHash library: https://github.com/Cyan4973/xxHash
* unordered_set - hash table for fast searching
* openmp - multithreading
C++ code (compiled in Visual Studio 2017 x64):
```
#include <iostream>
#include <fstream>
#include <string>
#include <unordered_set>
#include "xxhash.h"
std::unordered_set<unsigned long long> hashes;
void brute(std::string str, unsigned long long seed)
{
if (str.size() < 6)
{
for (int i = 97; i <= 122; ++i) brute(str + char(i), seed);
}
else
{
unsigned long long h = XXH64(str.c_str(), 6, seed);
if (hashes.find(h) != hashes.end())
{
#pragma omp critical
{
std::cout << seed << " --- " << str << std::endl;
}
}
}
}
int main()
{
std::ifstream f("hashes.txt");
unsigned long long h;
while (f >> h) hashes.insert(h);
int total = 0;
#pragma omp parallel for
for (int s = 0; s < 10000; ++s)
{
#pragma omp critical
{
std::cout << ++total << " " << s << std::endl;
}
brute(std::string(), s);
}
std::cout << "Done" << std::endl;
return 0;
}
```
I've runned it overnight on a powerful multicore computer and it has found the password with the seed. Btw running it overnight wasn't really neccessary, it is quite fast...
```
123 --- nsafbi
```
The multithreading is not here a performance gain, because the seed space is uniformly diveded and the seed is found by the first thread.
So the flag is:
```
WPI{nsafbi123}
```