Sophie

Sophie

distrib > Mageia > 1 > i586 > media > core-updates-src > by-pkgid > 16663c1804345c6bc27a585abe539da8 > files > 21

bind-9.8.3P4-1.mga1.src.rpm

#include <stdio.h>
#include <string.h>
int main(int argc, char **argv)
{
	FILE *f=fopen("/dev/urandom", "r");
	char key[61];
	int i=0;
	char tmp;
	memset(key, 0, 61);
	while(i<60) {
		tmp=fgetc(f);
		if((tmp>='a' && tmp<='z') ||
		   (tmp>='A' && tmp<='Z') ||
		   (tmp>='0' && tmp<='9'))
			key[i++]=tmp;
	}
	puts(key);
	fclose(f);
	return(0);
}