Ⅰ C代碼自動生成器
用 Excel 拼接 不就得了.
Ⅱ 如何用C語言編一個密碼生成器
C語言實現密碼生成器,參考代碼如下:
#include
#include
#include
//constcharlower_chars[]="abcdefghijklmnopqrstuvwxyz";
//constcharupper_chars[]="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
//constcharnumber_chars[]="0123456789";
constcharlower_chars[]="abcdefghijkmnpqrstuvwxyz";//noloro
constcharupper_chars[]="ABCDEFGHJKLMNPQRSTUVWXYZ";//noIorO
constcharnumber_chars[]="23456789";//no1or0
constcharspecial_chars[]="!@#$%^&*()-=_+[]{};:'"<>,.?/";
constint_ks_pass_len=17;
voidmkpass(charpass[_ks_pass_len+1])
{
inti=0,j=0,k=0,n=0;
n=_ks_pass_len/4;
for(;i<n;i++)
{
pass[i]=lower_chars[rand()%(strlen(lower_chars))];
pass[i+n]=upper_chars[rand()%(strlen(upper_chars))];
pass[i+2*n]=number_chars[rand()%(strlen(number_chars))];
pass[i+3*n]=special_chars[rand()%(strlen(special_chars))];
}
j=_ks_pass_len-4*n;
for(i=0;i<j;i++){
pass[i+4*n]=special_chars[rand()%(strlen(special_chars))];
}
//字元亂序
for(i=0;i<32;i++)
{
j=rand()%(_ks_pass_len);
k=pass[j];
pass[j]=pass[i%_ks_pass_len];
pass[i%_ks_pass_len]=k;
}
pass[_ks_pass_len]='