-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
43 lines (34 loc) · 926 Bytes
/
main.cpp
File metadata and controls
43 lines (34 loc) · 926 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <iostream>
#include <vector>
#include "md5.cpp"
using namespace std;
int main(int argc, char *argv[])
{
int hashTotal=0;
vector<string> listOfHash;
string hashOutConcat="";
cout<<"Number of hashes: ";
cin>>hashTotal;
listOfHash.resize(0);
for(int i = 0; i < hashTotal; i++) {
string tempRead;
cout<<i<<": ";
cin>>tempRead;
listOfHash.push_back(tempRead);
}
for(int i=0; i<hashTotal; i++) {
bool cracked=false;
for(int i2=0; i2<=999 & !cracked; i2++) {
string testValue = to_string(i2);
while(testValue.length()<3) testValue="0"+testValue;
if(md5(testValue)==listOfHash[i]) {
hashOutConcat=hashOutConcat+testValue;
cracked=true;
}
}
}
cout<<endl<<endl<<"Output: '"<<hashOutConcat<<"'";
int ign;
cin>>ign;
return 0;
}