Skip to content

Instantly share code, notes, and snippets.

@ravikishore1993
Last active December 14, 2015 15:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ravikishore1993/5be9af828d2476f4e654 to your computer and use it in GitHub Desktop.
Save ravikishore1993/5be9af828d2476f4e654 to your computer and use it in GitHub Desktop.
Binary Level
#include<iostream>
#include<cstring>
#include<cstdlib>
#include<ctime>
using namespace std;
int check(char*);
char* md5_custom(char*);
main(int argv,char **argc)
{
if(argv >3)
{
srand(time(NULL));
int size = argv<<3 , select = rand() % (argv-1) +1 ;
char password[size] ;
char *size_pass = password ;
char *check_pass = size_pass + sizeof(password) ;
*check_pass = '0';
strcpy(password,argc[select]);
if (check(md5_custom( password)))
*check_pass = '1' ;
if(*check_pass == '1')
cout<<" #################### is the password ! . Good Job ! "<<endl;
else
cout<<"Md5-custom Trolls ! Collide the 3 millionth one ! "<<endl;
}
else
{
cout<<" I Want More Passwords !!!"<<endl ;
}
}
char* md5_custom(char* password)
{
// Here comes a large code that calculates ' md5(password) '
// return the hash ;
}
int check(char* hash)
{
for(int i = 0 ; i < 32 ; i++)
{
if(hash[i] != "f2332291a6e1e6154f3cf4ad8b7504d8"[i])
return 0 ;
}
return 1 ;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment