暴力破解密码C语言.docVIP

  • 274
  • 0
  • 约1.04千字
  • 约 3页
  • 2020-10-06 发布于浙江
  • 举报
#includestdio.h #includetime.h #includestdlib.h #includemalloc.h #includestring.h int main() { char a[10],b[]={000000},c[]={0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ}; int d[6]; clock_t start,finish; double TheTimes; do { printf(请输入六位密码:); gets(a); if(a[6]==\0) { break; } printf(ERROR\n ); } while(1); start=clock(); while(1) { for(d[5]=0;d[5]64;d[5]++) { b[5]=c[d[5]]; for(d[4]=0;d[4]64;d[4]++) { b[4]=c[d[4]]; for(d[3]=0;d[3]64;d[3]++) { b[3]=c[d[3]]; for(d[2]=0;d[2]64;d[2]++) { b[2]=c[d[2]]; for(d[1]=0;d[1]64;d[1]++) { b[1]=c[d[1]]; for(d[0]=0;d[0]64;d[0]++) { b[0]=c[d[0]]; if(strcmp(a,b)==0) { printf(破解密码得:); puts(b); finish=clock(); TheTimes=(double)((finish-start)/CLOCKS_PER_SEC); printf(用时%f秒。\n,TheTimes); return(0); } } } } } } } } return(0); }

文档评论(0)

1亿VIP精品文档

相关文档