Hi guys , I have to do simple brute force program for my homework and I dont know what to do. It should work when I put there some password(max. 4 letters for examle: azxd ) and the program should start to trying every possible combination one at time like a, b, ...z, then aa, ab, ac, ... zz, until it finds the right one. There should be best infinite loop but i dont know how to write it in C. Can someone help me please?
Oremuss
0
Newbie Poster
Recommended Answers
Jump to PostIf the password is maximum four letters long, you won't need an infinite loop. I think a combination of four variables can be arranged, at most, 4! times:
4! = 4*3*2*1 = 24
. (It has been several years since my last stats class, so I could be wrong. But there …
Jump to PostUpdated code:
addedint permutationCount = 1;
,permutationCount += 1;
, andprintf ("%d", permutationCount);
#define AsciiArraySize 52 int i,j = 0; int permutationCount = 1; //keeps track of # of permutations char asciiArray[AsciiArraySize]; int arrCount = 0; // insert upper case letters // …
All 8 Replies
DavidB
44
Junior Poster
Oremuss
0
Newbie Poster
cgeier
187
Junior Poster
cgeier
187
Junior Poster
cgeier
187
Junior Poster
cgeier
187
Junior Poster
cgeier
187
Junior Poster
Oremuss
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.