I have a piece of code that checks the hash of the guessed password.
if (temp == val)
{
printf("%s\n", paswrd);
return 0;
}
else {
printf("Not same\n");
eprintf("%s\n", val);
eprintf("%s\n", temp);
}
Temp is the entered hash. Val is the hash crypt makes. I have an eprintf above this which outputs temp and val. They are the same. (The test password I made is A.) However, the if statement prints Not same
. Then it eprintfs val and temp again, and they are the same, again. I also measured the strlen and they have the same length, so no extra spaces. Why is this happening?