Here is a quick test case for crack direct from the CS50 AP material,

$ ./crack 50fkUxYHbnXGw

Here is my code,

#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

I am misuing char *crypt(const char *key, const char *salt);

  • That's a typo in the spec. If you look at the top of the page, it is correct in the first example. Currently fixing. – curiouskiwi Jan 29 '19 at 21:53

Unfortunately, there was a typo in the spec. The first example given was correct:

 ./crack 50fkUxYHbnXGw

but when repeated later in the spec, it showed ROFL in error.

This has been corrected. Thanks for the report.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .