Here is a quick test case for crack direct from the CS50 AP material,
$ ./crack 50fkUxYHbnXGw ROFL
Here is my code,
#define _XOPEN_SOURCE
#include <unistd.h>
#include <stdio.h>
int main(int argc, char * argv[])
{
printf("%s\n", crypt("ROFL", "50"));
}
Now that's supposed to print 50fkUxYHbnXGw
, correct (as per the example above cited from the docs)? Instead what I get is,
clang -ggdb3 -O0 -std=c11 -Wall -Werror -Wshadow crack.c -lcrypt -lcs50 -lm -o crack && ./crack
50JGnXUgaafgc
I am misuing char *crypt(const char *key, const char *salt);