AES里面通常都需要用到16位字符的密码,很难想 就随机生成了
int main() { FILE* fp=fopen("pass.h","w+"); fprintf(fp,"unsigned char pass[17]={0}; "); srand(::GetTickCount()); char ch[16]={0}; for(int i=0;i<16;++i) { int n; do { n=rand()%16; }while(ch[n]);//index fprintf(fp,"pass[%d]=%02x; ",n,(unsigned char)(rand()%256)); ch[n]=1; } fclose(fp); return 0; }