Tuesday, December 22, 2015

Simple hash plaintext pair generator

This is a simple plaintext hash pair generator. You write out your pairs and load them to a database for easy lookup. That or just make rainbow tables. Who cares? It's MD5s. You can get the header and C++ file here and and there is a code example. Zedwood's C++ MD5 Function This is probably the simplest hashing implementation in C++ you could ever find. There are a few other examples on zedwood.com.

The program opens your wordlist file and reads through it line by line and outputs the plaintext hash pairs to a new file. Once again probably the shittiest possible use of command line arguments. But it works.

//Simple example that converts a wordlist from plaintext to plaintext and hash pair tab delimited.
#include <string>
#include <sstream>
#include <iostream>
#include <cctype>
#include <fstream>
#include "md5.h"
#include <cstring>
using namespace std;


int main (int argc, char* argv[2])



{ofstream myfile;
myfile.open (argv[2]);

{ string line; ifstream infile (argv[1]);

if (infile.is_open())

{ while ( getline (infile,line) )

myfile << md5(line) << endl;
cout << line << endl;
string t = md5(line);
cout << t << endl;
}

 else cout << "Unable to open file" << endl;
}
return 0; }


No comments:

Post a Comment