I've been dealing with the exact same problem some time ago. Haven't found the algorithm yet to solve the issue at hand but haven't had much time either for dealing with it.
Hi all, it’s been a while since I have been on here, how are we all? I have been playing around with making a program that will manipulate a wordlist to pipe into jtr. Now I’m not sure if there is a problem at all but I think there might be a logic error in a function I am playing around with. Now here is a chunk of the program (ill post the full source once it is finished)
Now what the above program dose is take for example abc and turn it into abc, Abc, ABc, ABC, AbC, aBc, aBC, abC. Now it works with 3 letter words, but I am not confident that it works with longer words, which doesn’t really make sense. But the totals that the program is giving me is different to what i am working out on a calculator. but it has been a long day and i could be making a simple maths error :SCode:#include <cstdlib> #include <iostream> using namespace std; long int count = 0; void attcase (string str,int i){ ::count++; cout << str << endl; while (i<str.length()){ str[i]=toupper(str[i]); i++; attcase(str,i); str[i-1]=tolower(str[i-1]); } return; } int main(int argc, char *argv[]) { attcase("abcdefghijklmnopqrstuvwxyz",0); cout << ::count << endl; system("PAUSE"); return EXIT_SUCCESS; }
What do you think? Oh it can take a considerable time longer if your print every word to the screen but if you comment out “ cout << str << endl; “ it will run incredibly faster. And just give you a total at the end.
I've been dealing with the exact same problem some time ago. Haven't found the algorithm yet to solve the issue at hand but haven't had much time either for dealing with it.
Tiocfaidh ár lá
I started this a few months ago as well, but ditch it because I couldn’t find a efficient algorithm. But had an idea today and I think this one works. If it works for a 3 character string, it should work no matter what the length is. But it has been a long day and as I said before the numbers just aren’t adding up right.
I think I might just have to try it with a 5 character string and go thought it and check the output, but that’s just such a tedious process.
Yup it is. I might think over it again too. But that will need some more time. If you found a result before, just let me know![]()
Tiocfaidh ár lá
try thisCode:str[i]=toupper(str[i]); i++; attcase(str,i); str[i-1]=tolower(str[i-1]);
is it meant to toupper [0] then lower[1] then upeer[2]Code:str[i]=toupper(str[i]); i++; attcase(str,i); str[i-1]=tolower(str[i-1]); i++;
I think at the moment it does
upper [0] lower[1] upper[1] lower[2] upper[2]
That code doesn’t work, I ran it with abc and I got this abc, Abc, ABc, ABC, abC
After some sleep woke up this morning and had a look at my maths again and did a check on running it with 4 characters and 5 and from what I could see it works...
With 4 characters
Code:abcd Abcd ABcd ABCd ABCD ABcD AbCd AbCD AbcD aBcd aBCd aBCD aBcD abCd abCD abcD 16
I dunno if your objective is to write this code on your own for fun or learning or whatever, but if you'd like someone just to throw a solution out there... well I have C code for this on my website, just scroll down to "Uppercase Lowercase Combinator". The code I wrote also takes into account that numbers and symbols don't have uppercase equivalents so it doesn't throw out extra passwords that are identical. My code should be pretty fast too, it doesn't deal with any dynamic memory allocation or fancy algorithms, it's pretty much just bitwise operations.
http://virjacode.com/
Ask questions on the open forums, that way everybody benefits from the solution, and everybody can be corrected when they make mistakes. Don't send me private messages asking questions that should be asked on the open forums, I won't respond. I decline all "Friend Requests".