Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
A common approach in password cracking is to try hashing the entries of a dictionary first, before resulting to brute forcing random combinations. en.wikipedia.org/wiki/Dictionary_attack
I've added the IO code, but I'm sure that's not the issue because I can edit the read data just fine. I should have clarified that it is the last line, free(temp); which cause the segfault.