#include #include #include //32 characters int main (int arc, char * argv[]) { MD5_CTX c; char md5buffer[512]; int bytesread; printf("Put something in the stdin of the program and it will generate a random block of text\n"); unsigned char md5result[16]; MD5_Init(&c); do { bytesread = fread(md5buffer, sizeof(char), 512, stdin); if (bytesread < 0) { printf("Error reading from STDIN\n"); return -1; } MD5_Update(&c, md5buffer, bytesread); } while (bytesread != 0); MD5_Final(md5result, &c); printf("\n"); int i = 0; while ( i < (16) ) { printf("%.2x",md5result[i]); i++; } printf("\n"); return 0; }