Sunday, December 27, 2015

Unfinished brute force example

Unfinished brute force example doesn't compare inputs just outputs hashes. There's a finished version of this program into another post. Like I said cleaning out my code folder.

//Simplest possible brute force program
//stuff to include
#include <string>
#include <sstream>
#include <iostream>
#include <cctype>
#include <fstream>
#include <stdio.h>
#include <string.h>
#include <openssl/md5.h>
using namespace std;

//variables we'll use the iterate through the string array in nested fashion
int a;
int b;
int c;
int d;
int e;
int f;
int g;

//our character array


//string array for characters we will iterate through
//string alphanum[] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "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"};

//main function where all of the magick happens
int main (int argc,char* argv[])

{




for (a=32; a<=126; a++){
for (b=32; b<=126; b++){
for (c=32; c<=126; c++){
for (d=32; d<=126; d++){
for (e=32; e<=126; e++){
for (f=32; f<=126; f++){
for (g=32; g<=126; g++){
//std::string s = static_cast<std::ostringstream&>(std::ostringstream().seekp(0) << alphanum[a] << alphanum[b] << alphanum[c] << alphanum[d] << alphanum[e] << alphanum[f] << alphanum[g]).str();

//std::string str1 (s);

//openssl md5 function
char A[char(a), char(b), char(c), char(d), char(e), char(f), char(g)];
A = new char[7];


//cout << "trying plaintext " << s << " |  md5 hash  "  << endl;






}
}
}
}

}

No comments:

Post a Comment