You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
rizzlehash/include/RH_ProcessBruteForce.h

91 lines
2.6 KiB

/*
* Copyright <20> 2015 Matthieu DUVAL, Rudy DUCHE
*
* This file is part of RizzleHash.
*
* RizzleHash is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* RizzleHash is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with RizzleHash. If not, see <http://www.gnu.org/licenses/>
*/
#ifndef RH_PROCESSBRUTEFORCE_H
#define RH_PROCESSBRUTEFORCE_H
#include <iostream>
#include <queue>
#include <string>
#include <sstream>
#include <functional>
#include "../include/RH_Encryption.h"
//#include <thread>
//#include <time.h>
//#include <atomic>
//#include <list>
//#include <stdlib.h>
//#include <vector>
//#include <mutex>
using namespace std;
class ProcessBruteForce
{
public:
struct statReturn
{
bool isFound = false;
uint32_t nbSecond;
uint32_t totalWords;
string currentWord;
string currentProcessName;
};
public:
ProcessBruteForce();
ProcessBruteForce(queue<statReturn> *q,int idx,int nbInstence,string hashString,string clef,uint32_t limite,bool verbose,string hashMethode);
void init(queue<statReturn> *q,int idx,int nbInstence,string hashString,string clef,uint32_t limite,bool verbose,string hashMethode);
void operator()();
virtual ~ProcessBruteForce();
private:
void bruteForce();
void recursiveFunction(uint32_t index);
void testSpeed(string currentWord);
private:
queue<statReturn> *q;
int idx;
int nbInstence;
bool verbose;
uint32_t nbWord;
function<string(string)> hashMethodeFunction;
bool keySet;
string clef;
uint32_t limite;
string hashString;
char* password;
bool isFound = false;
char tabChar[63] = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',
'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',
'0','1','2','3','4','5','6','7','8','9',' '};
short indexMin = 0;
short indexMax = 0;
// test de performaces
time_t clock;
};
#endif // BF_PROCESSBRUTEFORCE_H