Trying to finish the crack assignment and I'm getting different outputs using the crypt function with what I believe is the same input. Using a different set of code (that just returns the output of the crypt function for a given input) I determined that 'ea' should result in 500v45srcLSFs. However, as seen here I get 50FckqWvS18kY with this set of code. Would appreciate if someone could point out my error! My initial guess was that maybe I'm passing crypt a char[] instead of a char* but I couldn't fix this using the '&' operator.

Code snippet

1 Answer 1


Found the issue, the password I was passing in was not terminated with a null character. Fix was simply increasing the size of the password array by 1 and allocating '\0' to that space.

You must log in to answer this question.

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