原创,混合密码生成器,源码,可自己修改
密码生成范围:A-Z,a-z,0-9,@#$%^&*;先上代码: //VS2010 Project:
#include <iostream>
#include <algorithm>
#include <string>
#include <memory>
#include <cctype>
#include <tchar.h>// _TCHAR* argv[]
#include <wtypes.h>
#include <fstream>
using namespace std;
char sp;
void skimrand()
{
for (int s=0;s<100;s++)
rand();
cout<<endl<<"skim 100 rand nums..."<<endl;
}
void genTo(int count, int sn )
{ ofstream fout("key.txt",ios::app);
sn=sn/4;
for (int k=0;k<count;++k)
{
for (int m1=0;m1<sn;++m1)
{int temp=(rand()%26)+65;
cout<<(char)temp; fout<<(char)temp;
}
cout<<"-"; fout<<"-";
for (int m1=0;m1<sn;++m1)
{int temp=rand()%10;
cout<<temp; fout<<temp;
}
cout<<"-"; fout<<"-";
for (int m1=0;m1<sn;++m1)
{int temp=(rand()%26)+97;
cout<<(char)temp; fout<<(char)temp;
}
cout<<"-"; fout<<"-";
for (int m1=0;m1<sn;++m1)
{ sp=(char)(rand()%26 +65); sp=(char)(rand()%26 +97);
int temp=rand()%9;
cout<<sp; fout<<sp;
}
cout<<endl; fout<<endl;
}
fout.close();
}
int _tmain(int argc, _TCHAR* argv[])
{
char tcmd;
sp='@'; sp='#'; sp='$'; sp='%'; sp='^'; sp='&'; sp='*';
while (cin>>tcmd)
{
switch (tcmd)
{
case 'g': genTo(10,12); break;
case 't': genTo(20,12); break;
case 'p': genTo(50,12); break;
case 'G': genTo(10,16); break;
case 'T': genTo(20,16); break;
case 'P': genTo(50,16); break;
case 'q': return 0;
case 's' : skimrand(); break;
default: skimrand(); break;
}
}
return 0;
}
运行截图:http://www.52pojie.cn/forum.php?mod=image&aid=302283&size=300x300&key=07091668c040c1d0&nocache=yes&type=fixnone
运行后会生成key.txt存储密码。
希望大家多给评分,给个热心值吧!我会接着努力的\(^o^)/~
不懂还是要支持一下! 好东东 支持一下 刺蝴蝶De箫启灵 发表于 2014-7-14 11:56
......好吧。。。谢谢楼主
谢谢。。。{:1_906:} {:17_1061:}......好吧。。。谢谢楼主
好东东 支持一下 好的!试试去! 好吧。谢谢楼主分享 这样搞得自己都记不住 支持一下
页:
[1]
2