/* keygen.c - High entropy key generator - Don Yang (uguu.org) 01/06/05 */ #include #include #include int main(int argc, char **argv) { unsigned char key[256], x; unsigned int i, j, k; FILE *outfile; if( argc < 2 ) return printf("%s \n", *argv); if( (outfile = fopen(argv[1], "wb+")) == NULL ) return printf("Can not create %s\n", argv[1]); for(i = 0; i < 256; i++) key[i] = (unsigned char)i; srand((unsigned)time(NULL)); for(k = 0; k < 0x10000; k++) { i = (unsigned)rand() & 255; j = (unsigned)rand() & 255; x = key[i]; key[i] = key[j]; key[j] = x; } (void)fwrite(key, 256, 1, outfile); (void)fclose(outfile); return 0; }