Hot answers tagged

4 votes
Accepted

string comparison & crack.c

If you read the man page of the crypt function it says in one point: The return value points to static data whose content is overwritten by each call. So the first time you ...
user avatar
  • 7,326
3 votes
Accepted

Hacker2, Crack: Optimisations

For instance, the brute force search will at some point generate the same character sequences as in the dictionary, but how would the program know to avoid re-checking these same values without ...
user avatar
  • 17.4k
2 votes
Accepted

What's the purpose of the 'salt' string? Isn't it contained in the hashed string anyway?

The salt is used to influence the encryption process. If you call crypt twice on the same key passing in different salt each time, you'll get different hashes (results). The salt can be any two ...
user avatar
  • 17.4k
2 votes
Accepted

Reading a line from a file

First consider the size this elements have in the cs50 appliance. char = 1byte char* (pointer) = 4bytes You are declaring word and initializing it with the pointer returned by malloc, that is fine. ...
user avatar
  • 1,369
2 votes
Accepted

About the 'crack.c' part of the second hacker edition pset, what is really expected from us? (and a part about submitting)

So I'm wondering if submitting a program that would work but can't be actually tested is okay and is what is expected from us It is expected of you to find all the plaintext passwords of the hashed ...
user avatar
  • 7,326
1 vote
Accepted

Pset2 Hacker Edition- Crack.c

I think I solved it. It seems that I was overwriting my pointer to my allocated memory with another pointer (when I assigned attempt the output of the crypt function (another pointer - to the encoded ...
user avatar
  • 109
1 vote
Accepted

(Hacker2) Why am I getting a seg fault here from fgets?

Not really. The cause of the error involves some topics that you will study later in the course. I'll try to simplify my answer as much as possible, but don't panic if you don't fully understand what ...
user avatar
  • 17.4k

Only top scored, non community-wiki answers of a minimum length are eligible