啊!密码忘了!
里边有重要数据。
还好是des加密算法加的密难可能不是很大
我已写好解密算法,希望有高手帮我算一下
字典是[awergjtjklmnasdfgvcxcb]小字字母集,加标点,加[345678]的数字集组成的字典
第一位一定是小写字母
长度7-9位
只记得这么多了
我已生成了一个20来G的字典可要算1两个月,太吓人了,所想哪位高手帮我算出来
加密字串十进制:
[192 01 37 34 83 96 37 58]
(换入下面的test处)
下面是解密算法源码:
(嘻!写得可能不是很高速,我已多次用字典测试能正确解密)
// SaveMe.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include <iostream>
#include <stdio.h>
#include <fstream>
#include <string>
#include <time.h>
#include "windows.h"
#include "Global.h"
#pragma warning(once:4996)
#pragma warning(once:4267)
using namespace std;
bool DESInitStr(char *str,int len){
int i;
if(len<8){
for(;len<8;len++){
str[len]='0';
}
}else if(len>8){
for(i=8;i<len;i++){
str[i%8]=str[i%8]^str[i];
}
}
str[8]='/0';
return true;
}
int _tmain(int argc, _TCHAR* argv[])
{
char *ctt=new char[5000001],*ctt2=new char[5000001],thestr[16],*pstr1,*pstr2,msgstr[1000];
unsigned char crastr[9],savcra[10],tmpcra[9];
char path[]="E://dic.txt",logpath[]="E://cra.log",savcrapath[]="E://crasav.txt",logstr[200];
int n500000=1,isendrn;
unsigned long output[4],cnt=0;
unsigned long long filelength,len;
int len2,len3;
//crastr[0]=0xee;crastr[1]=0x56;crastr[2]=0x82;crastr[3]=0x55;crastr[4]=0x4f;crastr[5]=0x6b;crastr[6]=0xe7;crastr[7]=0x6f;crastr[8]=0;//test
thestr[8]=0;
ofstream flog,fsav;
fsav.open(savcrapath,ios_base::out|ios_base::binary);
if(!fsav.is_open())return 0;
flog.open(logpath,ios_base::out|ios_base::binary);
if(!flog.is_open())return 0;
ifstream inf;
inf.open(path,ios_base::in|ios_base::binary);
if(!inf.is_open())return 0;
inf.seekg(0,ios_base::end);
filelength=inf.tellg();
inf.seekg(0,ios_base::beg);
inf.read(ctt,5000000);
len=strlen(ctt);
if(ctt[len-1]=='/n')isendrn=1;else if(ctt[len-1]=='/r')isendrn=2;else isendrn=0;
sprintf(logstr,"the %d of 5M in %lu byte./r/n",n500000,filelength);
flog.write(logstr,strlen(logstr));
flog.flush();
pstr1=strtok(ctt,"/r/n");
pstr2=strtok(NULL,"/r/n");
if(pstr2==NULL)return 0;
while(pstr1!=NULL){
len3=len2=strlen(pstr1);
strncpy(thestr,pstr1,len2);thestr[len2]=0;
MD5(thestr,len2,output);
if(len2<8){for(;len2<8;len2++){thestr[len2]='0';}
}else if(len2>8){for(int i=8;i<len2;i++){thestr[i%8]=thestr[i%8]^thestr[i];}}
desinit((unsigned char*)thestr);
endes((unsigned char*)thecode,savcra);
if(strncmp((char*)savcra,(char*)crastr,8)==0){fsav.write(thestr,8);fsav.flush();MessageBox(NULL,thestr,"find one",0);break;}
cnt++;
pstr1=pstr2;
pstr2=strtok(NULL,"/r/n");
if(pstr2==NULL&&pstr1!=NULL&&!inf.eof()){
printf("done count %lu on the %d of 5M/n",cnt,n500000);
n500000++;
sprintf(logstr,"the %d of 5M in %lu byte./r/n",n500000,filelength);
flog.write(logstr,strlen(logstr));
flog.flush();fsav.flush();
strcpy(ctt,pstr1);
if(isendrn==1)strcat(ctt,"/r/n");else if(isendrn==2)strcat(ctt,"/n");
memset(ctt2,0,5000000);
inf.read(ctt2,5000000);
if(ctt2[strlen(ctt2)-1]=='/n')isendrn=1;else if(ctt2[strlen(ctt2)-1]=='/r')isendrn=2;else isendrn=0;
strcat(ctt,ctt2);
pstr1=strtok(ctt,"/r/n");
pstr2=strtok(NULL,"/r/n");
}
}
printf("done count %lu on the %d of 5M/n",cnt,n500000);
fsav.close();
flog.close();
inf.close();
system("pause");
return 0;
}
我先谢谢了!
汉!
算好了联系我重谢
QQ:wkongyun@gmail.com