everyone! I could use some help on crack.c problem. I tried to create a program that creates 1 to 4 random uppercase and lowercase chars, crypts them and compares them to hash. It works but it may take about a month to find the password, lol. I tried a different approach using words dictionary in cs50 ide. It also works for words that are on dictionary. But what about the random chars? Also random uppercase and lowercase chars? I am completely stuck. Anyone has a hint on that? Thanks in advance.

  • What kind of computer do you have? I generated all 4 char combinations from \0\0\0a to ZZZZ in almost 6 minutes...
    – NaCl
    Apr 15, 2017 at 1:48

1 Answer 1


You shouldn't create random combinations of letters, you should go through every possible combination of letters and try each combination only once like this (assuming only lowercase letters but in the actual crack program you need to do this for both uppercase and lowercase):

a, b, c, d, e ... z aa, ab, ac, ad ... az ba, bb, bc, bd ... bz

aaa, aab ... aba, abb, , abc ... azz ... zzz

So in short, you need to go from "a" to "zzzz", sort of in the same way you would count from 1 to 9999 but with the letters of the alphabet instead of numbers.

  • I have to agree.😀
    – fwoosh
    Mar 29, 2019 at 2:57

You must log in to answer this question.

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