Du bist nicht angemeldet.

Stilllegung des Forums
Das Forum wurde am 05.06.2023 nach über 20 Jahren stillgelegt (weitere Informationen und ein kleiner Rückblick).
Registrierungen, Anmeldungen und Postings sind nicht mehr möglich. Öffentliche Inhalte sind weiterhin zugänglich.
Das Team von spieleprogrammierer.de bedankt sich bei der Community für die vielen schönen Jahre.
Wenn du eine deutschsprachige Spieleentwickler-Community suchst, schau doch mal im Discord und auf ZFX vorbei!

Werbeanzeige

1

25.05.2014, 13:57

C++ Brute Force Algorythmus -> Passwörter durchprobieren

Hallo
Ich hab den Brute Force Code jetzt fertig nur wie lass ich das Programm jetzt die zip Datei öffnen und den ersten möglichen Key reinschrieben und wenn er nicht stimmt weiter mit dem zweiten Key... und so weiter... Wie geht das nun?
Da der Code sehr lang ist poste ich ihn vorerst noch nicht aber wenn ihr ihn braucht schriebt das einfach und dann poste ich ihn
Danke für euche Hilfe!

2

25.05.2014, 14:05

Wie du eine geschützte Zip mit C++ und verschiedenen Libs laden kannst und dabei automatisch ein Passwort verwenden kannst, findest du mit Sicherheit im Internet. Da bin ich mir ziemlich sicher - das Internet ist grooooß!


Wie du mithilfe von Bruteforce eine geschützte Zip knacken kannst, wird dir hier keiner sagen. Das ist illegal.
Aber mal vom rechtlichen abgesehen, dürfte eine reine BruteForce Methode bei heutigen Verschlüsselungstechniken einfach nutzlos sein. Schon mit einer einfachen monoalphabetischen Substitutionsverschlüsselung kann man das unbefugte Entschlüsseln mit der Brute-Force Methode unterbinden.

Wenn du dennoch dein Glück versuchen willst, wirst du, wie bereits geschrieben, woanders mehr Informationen beziehen können.
EnvisionGame(); EnableGame(); AchieveGame(); - Visionen kann man viele haben. Sie umzusetzen und auf das Ergebnis stolz zu sein ist die eigentliche Kunst.

Sylence

Community-Fossil

Beiträge: 1 663

Beruf: Softwareentwickler

  • Private Nachricht senden

3

25.05.2014, 14:33

Wie du mithilfe von Bruteforce eine geschützte Zip knacken kannst, wird dir hier keiner sagen. Das ist illegal.


Warum sollte ihm das keiner sagen? Wie du doch schon selber festgestellt hast wird auch mit dem Wissen nichts anfangen können weil das eben zu lange dauert.
Ob das illegal ist bezweifel ich auch mal stark. Illegal wird es erst, wenn man damit an Daten kommt, die nicht für einen bestimmt sind...

@layle:
Pseudocode:

Quellcode

1
2
3
4
5
6
7
8
9
foreach( password )
{
   zipfile.open( file, password )

   if( content_valid( zipfile ) )
   {
      // Passwort geknackt
   }
}

4

25.05.2014, 14:52

Wie du mithilfe von Bruteforce eine geschützte Zip knacken kannst, wird dir hier keiner sagen. Das ist illegal.


Warum sollte ihm das keiner sagen? Wie du doch schon selber festgestellt hast wird auch mit dem Wissen nichts anfangen können weil das eben zu lange dauert.
Ob das illegal ist bezweifel ich auch mal stark. Illegal wird es erst, wenn man damit an Daten kommt, die nicht für einen bestimmt sind...

@layle:
Pseudocode:

Quellcode

1
2
3
4
5
6
7
8
9
foreach( password )
{
   zipfile.open( file, password )

   if( content_valid( zipfile ) )
   {
      // Passwort geknackt
   }
}



Danke! Nur leider wie kann ich das im Code einbauen? Hab gerade wieder ein Blackout... :dash: :dash: :dash:
Hier der Code:

C-/C++-Quelltext

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
#include <iostream>
#include <ctime>
#include <string>
using namespace std;
string crackPassword(string pass);
long long int attempt;
clock_t start_t, end_t;

int main(){
    int wait;
    string password;

    cout << "Enter the password to crack : ";
    cin >> password;

        cout << "\n\n\n\n" << "CRACKED THE PASSWORD!" << "\n"<<"\n"<<"\n";
        cout << "The password : " << crackPassword(password) << "\n";
        cout << "The time duration  passed : " << (double)(end_t - start_t) / 1000 << " seconds" << endl << endl;
        cin >> wait;
    return 0;
}

string crackPassword(string pass){
    int digit[7], alphabetSet = 1, passwordLength = 1;
    start_t = clock();

    string test, alphabet = "1337 also daktari is pro";
    while (1){


        switch (passwordLength){
        case 1:
            while (alphabetSet<4){
                switch (alphabetSet){
                case 1: alphabet = "-0123456789";
                    cout << endl << endl << "Testing only digits(0123456789) - 10 Characters, please wait";  break;
                case 2: alphabet = "-abcdefghijklmnopqrstuvwxyz";
                    cout << endl << endl << "Couldn't find the password, increasing the searching level." << endl << endl << "Testing only lowercase characters(abcdefghijklmnopqrstuvwxyz) - 26 Characters, please wait";  break;
                case 3: alphabet = "-ABCDEFGHIJKLMNOPQRSTUVWXYZ";
                    cout << endl << endl << "Couldn't find the password, increasing the searching level." << endl << endl << "Testing only uppercase characters(ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 26 Characters, please wait";  break;
                }

                for (digit[0] = 1; digit[0]<alphabet.length(); digit[0]++){
                    attempt++;
                    if (attempt % 2500000 == 0) cout << ".";
                    test = alphabet[digit[0]];
                    for (int i = 1; i<passwordLength; i++)
                    if (alphabet[digit[i]] != '-')test += alphabet[digit[i]];
                    if (pass.compare(test) == 0){ end_t = clock(); return test; }
                }
                alphabetSet++;
            }
            break;
        case 2:
            alphabetSet = 1;
            while (alphabetSet<6){
                switch (alphabetSet){
                case 1: alphabet = "-0123456789";
                    cout << endl << endl << "Testing only digits(0123456789) - 10 Characters, please wait";  break;
                case 2: alphabet = "-abcdefghijklmnopqrstuvwxyz";
                    cout << endl << endl << "Couldn't find the password, increasing the searching level." << endl << endl << "Testing only lowercase characters(abcdefghijklmnopqrstuvwxyz) - 26 Characters, please wait";  break;
                case 3: alphabet = "-ABCDEFGHIJKLMNOPQRSTUVWXYZ";
                    cout << endl << endl << "Couldn't find the password, increasing the searching level." << endl << endl << "Testing only uppercase characters(ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 26 Characters, please wait";  break;
                case 4: alphabet = "-0123456789abcdefghijklmnopqrstuvwxyz";
                    cout << endl << endl << "Couldn't find the password, increasing the searching level." << endl << endl << "Testing lowercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyz) - 36 Characters, please wait";  break;
                case 5: alphabet = "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
                }


                for (digit[1] = 0; digit[1]<alphabet.length(); digit[1]++)
                for (digit[0] = 1; digit[0]<alphabet.length(); digit[0]++){
                    attempt++;
                    if (attempt % 2500000 == 0) cout << ".";
                    test = alphabet[digit[0]];
                    for (int i = 1; i<passwordLength; i++)
                    if (alphabet[digit[i]] != '-')test += alphabet[digit[i]];
                    if (pass.compare(test) == 0){ end_t = clock(); return test; }
                }
                alphabetSet++;
            }
            break;
        case 3:
            alphabetSet = 1;
            while (alphabetSet<8){
                switch (alphabetSet){
                case 1: alphabet = "-0123456789";
                    cout << endl << endl << "Testing only digits(0123456789) - 10 Characters, please wait";  break;
                case 2: alphabet = "-abcdefghijklmnopqrstuvwxyz";
                    cout << endl << endl << "Couldn't find the password, increasing the searching level." << endl << endl << "Testing only lowercase characters(abcdefghijklmnopqrstuvwxyz) - 26 Characters, please wait";  break;
                case 3: alphabet = "-ABCDEFGHIJKLMNOPQRSTUVWXYZ";
                    cout << endl << endl << "Couldn't find the password, increasing the searching level." << endl << endl << "Testing only uppercase characters(ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 26 Characters, please wait";  break;
                case 4: alphabet = "-0123456789abcdefghijklmnopqrstuvwxyz";
                    cout << endl << endl << "Couldn't find the password, increasing the searching level." << endl << endl << "Testing lowercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyz) - 36 Characters, please wait";  break;
                case 5: alphabet = "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
                    cout << endl << endl << "Couldn't find the password, increasing the searching level." << endl << endl << "Testing uppercase characters and numbers(0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 36 Characters, please wait";  break;
                case 6: alphabet = "-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
                    cout << endl << endl << "Couldn't find the password, increasing the searching level." << endl << endl << "Testing lowercase, uppercase characters(abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 52 Characters, please wait";  break;
                case 7: alphabet = "-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
                    cout << endl << endl << "Couldn't find the password, increasing the searching level." << endl << endl << "Testing lowercase, uppercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 62 Characters, please wait";  break;
                }
                for (digit[2] = 0; digit[2]<alphabet.length(); digit[2]++)
                for (digit[1] = 0; digit[1]<alphabet.length(); digit[1]++)
                for (digit[0] = 1; digit[0]<alphabet.length(); digit[0]++){
                    attempt++;
                    if (attempt % 2500000 == 0) cout << ".";
                    test = alphabet[digit[0]];
                    for (int i = 1; i<passwordLength; i++)
                    if (alphabet[digit[i]] != '-')test += alphabet[digit[i]];
                    if (pass.compare(test) == 0){ end_t = clock(); return test; }
                }
                alphabetSet++;
            }
            break;
        case 4:
            alphabetSet = 1;
            while (alphabetSet<8){
                switch (alphabetSet){
                case 1: alphabet = "-0123456789";
                    cout << endl << endl << "Testing only digits(0123456789) - 10 Characters, please wait";  break;
                case 2: alphabet = "-abcdefghijklmnopqrstuvwxyz";
                    cout << endl << endl << "Couldn't find the password, increasing the searching level." << endl << endl << "Testing only lowercase characters(abcdefghijklmnopqrstuvwxyz) - 26 Characters, please wait";  break;
                case 3: alphabet = "-ABCDEFGHIJKLMNOPQRSTUVWXYZ";
                    cout << endl << endl << "Couldn't find the password, increasing the searching level." << endl << endl << "Testing only uppercase characters(ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 26 Characters, please wait";  break;
                case 4: alphabet = "-0123456789abcdefghijklmnopqrstuvwxyz";
                    cout << endl << endl << "Couldn't find the password, increasing the searching level." << endl << endl << "Testing lowercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyz) - 36 Characters, please wait";  break;
                case 5: alphabet = "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
                    cout << endl << endl << "Couldn't find the password, increasing the searching level." << endl << endl << "Testing uppercase characters and numbers(0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 36 Characters, please wait";  break;
                case 6: alphabet = "-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
                    cout << endl << endl << "Couldn't find the password, increasing the searching level." << endl << endl << "Testing lowercase, uppercase characters(abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 52 Characters, please wait";  break;
                case 7: alphabet = "-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
                    cout << endl << endl << "Couldn't find the password, increasing the searching level." << endl << endl << "Testing lowercase, uppercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 62 Characters, please wait";  break;
                }

                for (digit[3] = 0; digit[3]<alphabet.length(); digit[3]++)
                for (digit[2] = 0; digit[2]<alphabet.length(); digit[2]++)
                for (digit[1] = 0; digit[1]<alphabet.length(); digit[1]++)
                for (digit[0] = 1; digit[0]<alphabet.length(); digit[0]++){
                    attempt++;
                    if (attempt % 2500000 == 0) cout << ".";
                    test = alphabet[digit[0]];
                    for (int i = 1; i<passwordLength; i++)
                    if (alphabet[digit[i]] != '-')test += alphabet[digit[i]];
                    if (pass.compare(test) == 0){ end_t = clock(); return test; }
                }
                alphabetSet++;
            }
            break;
        case 5:
            alphabetSet = 1;
            while (alphabetSet<8){
                switch (alphabetSet){
                case 1: alphabet = "-0123456789";
                    cout << endl << endl << "Testing only digits(0123456789) - 10 Characters, please wait";  break;
                case 2: alphabet = "-abcdefghijklmnopqrstuvwxyz";
                    cout << endl << endl << "Couldn't find the password, increasing the searching level." << endl << endl << "Testing only lowercase characters(abcdefghijklmnopqrstuvwxyz) - 26 Characters, please wait";  break;
                case 3: alphabet = "-ABCDEFGHIJKLMNOPQRSTUVWXYZ";
                    cout << endl << endl << "Couldn't find the password, increasing the searching level." << endl << endl << "Testing only uppercase characters(ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 26 Characters, please wait";  break;
                case 4: alphabet = "-0123456789abcdefghijklmnopqrstuvwxyz";
                    cout << endl << endl << "Couldn't find the password, increasing the searching level." << endl << endl << "Testing lowercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyz) - 36 Characters, please wait";  break;
                case 5: alphabet = "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
                    cout << endl << endl << "Couldn't find the password, increasing the searching level." << endl << endl << "Testing uppercase characters and numbers(0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 36 Characters, please wait";  break;
                case 6: alphabet = "-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
                    cout << endl << endl << "Couldn't find the password, increasing the searching level." << endl << endl << "Testing lowercase, uppercase characters(abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 52 Characters, please wait";  break;
                case 7: alphabet = "-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
                    cout << endl << endl << "Couldn't find the password, increasing the searching level." << endl << endl << "Testing lowercase, uppercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 62 Characters, please wait";  break;
                }
                for (digit[4] = 0; digit[4]<alphabet.length(); digit[4]++)
                for (digit[3] = 0; digit[3]<alphabet.length(); digit[3]++)
                for (digit[2] = 0; digit[2]<alphabet.length(); digit[2]++)
                for (digit[1] = 0; digit[1]<alphabet.length(); digit[1]++)
                for (digit[0] = 1; digit[0]<alphabet.length(); digit[0]++){
                    attempt++;
                    if (attempt % 2500000 == 0) cout << ".";
                    test = alphabet[digit[0]];
                    for (int i = 1; i<passwordLength; i++)
                    if (alphabet[digit[i]] != '-')test += alphabet[digit[i]];
                    if (pass.compare(test) == 0){ end_t = clock(); return test; }
                }
                alphabetSet++;
            }
            break;
        case 6:
            alphabetSet = 1;
            while (alphabetSet<8){
                switch (alphabetSet){
                case 1: alphabet = "-0123456789";
                    cout << endl << endl << "Testing only digits(0123456789) - 10 Characters, please wait";  break;
                case 2: alphabet = "-abcdefghijklmnopqrstuvwxyz";
                    cout << endl << endl << "Couldn't find the password, increasing the searching level." << endl << endl << "Testing only lowercase characters(abcdefghijklmnopqrstuvwxyz) - 26 Characters, please wait";  break;
                case 3: alphabet = "-ABCDEFGHIJKLMNOPQRSTUVWXYZ";
                    cout << endl << endl << "Couldn't find the password, increasing the searching level." << endl << endl << "Testing only uppercase characters(ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 26 Characters, please wait";  break;
                case 4: alphabet = "-0123456789abcdefghijklmnopqrstuvwxyz";
                    cout << endl << endl << "Couldn't find the password, increasing the searching level." << endl << endl << "Testing lowercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyz) - 36 Characters, please wait";  break;
                case 5: alphabet = "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
                    cout << endl << endl << "Couldn't find the password, increasing the searching level." << endl << endl << "Testing uppercase characters and numbers(0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 36 Characters, please wait";  break;
                case 6: alphabet = "-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
                    cout << endl << endl << "Couldn't find the password, increasing the searching level." << endl << endl << "Testing lowercase, uppercase characters(abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 52 Characters, please wait";  break;
                case 7: alphabet = "-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
                    cout << endl << endl << "Couldn't find the password, increasing the searching level." << endl << endl << "Testing lowercase, uppercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 62 Characters, please wait";  break;
                }
                for (digit[5] = 0; digit[5]<alphabet.length(); digit[5]++)
                for (digit[4] = 0; digit[4]<alphabet.length(); digit[4]++)
                for (digit[3] = 0; digit[3]<alphabet.length(); digit[3]++)
                for (digit[2] = 0; digit[2]<alphabet.length(); digit[2]++)
                for (digit[1] = 0; digit[1]<alphabet.length(); digit[1]++)
                for (digit[0] = 1; digit[0]<alphabet.length(); digit[0]++){
                    attempt++;
                    if (attempt % 2500000 == 0) cout << ".";
                    test = alphabet[digit[0]];
                    for (int i = 1; i<passwordLength; i++)
                    if (alphabet[digit[i]] != '-')test += alphabet[digit[i]];
                    if (pass.compare(test) == 0){ end_t = clock(); return test; }
                }
                alphabetSet++;
            }
            break;
        case 7:
            alphabetSet = 1;
            while (alphabetSet<8){
                switch (alphabetSet){
                case 1: alphabet = "-0123456789";
                    cout << endl << endl << "Testing only digits(0123456789) - 10 Characters, please wait";  break;
                case 2: alphabet = "-abcdefghijklmnopqrstuvwxyz";
                    cout << endl << endl << "Couldn't find the password, increasing the searching level." << endl << endl << "Testing only lowercase characters(abcdefghijklmnopqrstuvwxyz) - 26 Characters, please wait";  break;
                case 3: alphabet = "-ABCDEFGHIJKLMNOPQRSTUVWXYZ";
                    cout << endl << endl << "Couldn't find the password, increasing the searching level." << endl << endl << "Testing only uppercase characters(ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 26 Characters, please wait";  break;
                case 4: alphabet = "-0123456789abcdefghijklmnopqrstuvwxyz";
                    cout << endl << endl << "Couldn't find the password, increasing the searching level." << endl << endl << "Testing lowercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyz) - 36 Characters, please wait";  break;
                case 5: alphabet = "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
                    cout << endl << endl << "Couldn't find the password, increasing the searching level." << endl << endl << "Testing uppercase characters and numbers(0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 36 Characters, please wait";  break;
                case 6: alphabet = "-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
                    cout << endl << endl << "Couldn't find the password, increasing the searching level." << endl << endl << "Testing lowercase, uppercase characters(abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 52 Characters, please wait";  break;
                case 7: alphabet = "-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
                    cout << endl << endl << "Couldn't find the password, increasing the searching level." << endl << endl << "Testing lowercase, uppercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 62 Characters, please wait";  break;
                }
                for (digit[6] = 0; digit[6]<alphabet.length(); digit[6]++)
                for (digit[5] = 0; digit[5]<alphabet.length(); digit[5]++)
                for (digit[4] = 0; digit[4]<alphabet.length(); digit[4]++)
                for (digit[3] = 0; digit[3]<alphabet.length(); digit[3]++)
                for (digit[2] = 0; digit[2]<alphabet.length(); digit[2]++)
                for (digit[1] = 0; digit[1]<alphabet.length(); digit[1]++)
                for (digit[0] = 1; digit[0]<alphabet.length(); digit[0]++){
                    attempt++;
                    if (attempt % 2500000 == 0) cout << ".";
                    test = alphabet[digit[0]];
                    for (int i = 1; i<passwordLength; i++)
                    if (alphabet[digit[i]] != '-')test += alphabet[digit[i]];
                    if (pass.compare(test) == 0){ end_t = clock(); return test; }
                }
                alphabetSet++;
            }
            break;
        case 8:
            alphabetSet = 1;
            while (alphabetSet<8){
                switch (alphabetSet){
                case 1: alphabet = "-0123456789";
                    cout << endl << endl << "Testing only digits(0123456789) - 10 Characters, please wait";  break;
                case 2: alphabet = "-abcdefghijklmnopqrstuvwxyz";
                    cout << endl << endl << "Couldn't find the password, increasing the searching level." << endl << endl << "Testing only lowercase characters(abcdefghijklmnopqrstuvwxyz) - 26 Characters, please wait";  break;
                case 3: alphabet = "-ABCDEFGHIJKLMNOPQRSTUVWXYZ";
                    cout << endl << endl << "Couldn't find the password, increasing the searching level." << endl << endl << "Testing only uppercase characters(ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 26 Characters, please wait";  break;
                case 4: alphabet = "-0123456789abcdefghijklmnopqrstuvwxyz";
                    cout << endl << endl << "Couldn't find the password, increasing the searching level." << endl << endl << "Testing lowercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyz) - 36 Characters, please wait";  break;
                case 5: alphabet = "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
                    cout << endl << endl << "Couldn't find the password, increasing the searching level." << endl << endl << "Testing uppercase characters and numbers(0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ) - 36 Characters, please wait";  break;
                case 6: alphabet = "-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
                    cout << endl << endl << "Couldn't find the password, increasing the searching level." << endl << endl << "Testing lowercase, uppercase characters(abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 52 Characters, please wait";  break;
                case 7: alphabet = "-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
                    cout << endl << endl << "Couldn't find the password, increasing the searching level." << endl << endl << "Testing lowercase, uppercase characters and numbers(0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) - 62 Characters, please wait";  break;
                }
                for (digit[7] = 0; digit[7]<alphabet.length(); digit[7]++)
                for (digit[6] = 0; digit[6]<alphabet.length(); digit[6]++)
                for (digit[5] = 0; digit[5]<alphabet.length(); digit[5]++)
                for (digit[4] = 0; digit[4]<alphabet.length(); digit[4]++)
                for (digit[3] = 0; digit[3]<alphabet.length(); digit[3]++)
                for (digit[2] = 0; digit[2]<alphabet.length(); digit[2]++)
                for (digit[1] = 0; digit[1]<alphabet.length(); digit[1]++)
                for (digit[0] = 1; digit[0]<alphabet.length(); digit[0]++){
                    attempt++;
                    if (attempt % 2500000 == 0) cout << ".";
                    test = alphabet[digit[0]];
                    for (int i = 1; i<passwordLength; i++)
                    if (alphabet[digit[i]] != '-')test += alphabet[digit[i]];
                    if (pass.compare(test) == 0){ end_t = clock(); return test; }
                }
                alphabetSet++;
            }
            break;
        }
        cout << endl << endl << endl << endl << "*" << endl;
        cout << "*** Password length is not " << passwordLength << ". Increasing password length! ***";
        cout << endl << "*" << endl << endl;
        passwordLength++;
    }
}

BlueCobold

Community-Fossil

Beiträge: 10 738

Beruf: Teamleiter Mobile Applikationen & Senior Software Engineer

  • Private Nachricht senden

5

25.05.2014, 15:07

Ja frag halt endlich mal Google nach einer Zip-Bibliothek. 300 Zeilen (unglaublich redundanten) Code zu posten wird Dich da jedenfalls nicht weiter bringen.

PS:

C-/C++-Quelltext

1
2
3
4
5
6
7
8
                for (digit[7] = 0; digit[7]<alphabet.length(); digit[7]++)
                for (digit[6] = 0; digit[6]<alphabet.length(); digit[6]++)
                for (digit[5] = 0; digit[5]<alphabet.length(); digit[5]++)
                for (digit[4] = 0; digit[4]<alphabet.length(); digit[4]++)
                for (digit[3] = 0; digit[3]<alphabet.length(); digit[3]++)
                for (digit[2] = 0; digit[2]<alphabet.length(); digit[2]++)
                for (digit[1] = 0; digit[1]<alphabet.length(); digit[1]++)
                for (digit[0] = 1; digit[0]<alphabet.length(); digit[0]++){

Wenn Du Schleifen doch schon kennst, warum benutzt Du sie dann nicht entsprechend, sondern baust solche Mega-Verschachtelungen auf?
Teamleiter von Rickety Racquet (ehemals das "Foren-Projekt") und von Marble Theory

Willkommen auf SPPRO, auch dir wird man zu Unity oder zur Unreal-Engine raten, ganz bestimmt.[/Sarkasmus]

6

25.05.2014, 15:28

Ja frag halt endlich mal Google nach einer Zip-Bibliothek. 300 Zeilen (unglaublich redundanten) Code zu posten wird Dich da jedenfalls nicht weiter bringen.

PS:

C-/C++-Quelltext

1
2
3
4
5
6
7
8
                for (digit[7] = 0; digit[7]<alphabet.length(); digit[7]++)
                for (digit[6] = 0; digit[6]<alphabet.length(); digit[6]++)
                for (digit[5] = 0; digit[5]<alphabet.length(); digit[5]++)
                for (digit[4] = 0; digit[4]<alphabet.length(); digit[4]++)
                for (digit[3] = 0; digit[3]<alphabet.length(); digit[3]++)
                for (digit[2] = 0; digit[2]<alphabet.length(); digit[2]++)
                for (digit[1] = 0; digit[1]<alphabet.length(); digit[1]++)
                for (digit[0] = 1; digit[0]<alphabet.length(); digit[0]++){

Wenn Du Schleifen doch schon kennst, warum benutzt Du sie dann nicht entsprechend, sondern baust solche Mega-Verschachtelungen auf?


Danke für den Hinweis aber wie meinst du das mit der Zip Bibliothek? Und ich habe schon die ganze Zeit gegooglet und nix gefunden...

Sylence

Community-Fossil

Beiträge: 1 663

Beruf: Softwareentwickler

  • Private Nachricht senden

7

25.05.2014, 15:30

Und ich habe schon die ganze Zeit gegooglet und nix gefunden...


Glaub ich nicht so ganz

BlueCobold

Community-Fossil

Beiträge: 10 738

Beruf: Teamleiter Mobile Applikationen & Senior Software Engineer

  • Private Nachricht senden

8

25.05.2014, 15:58

Und bitte, bitte antworte nicht immer mit einem vollständigen Zitat. Das geht auch prima ohne oder nimm nur die relevanten Teile.
Teamleiter von Rickety Racquet (ehemals das "Foren-Projekt") und von Marble Theory

Willkommen auf SPPRO, auch dir wird man zu Unity oder zur Unreal-Engine raten, ganz bestimmt.[/Sarkasmus]

CeDoMain

Alter Hase

Beiträge: 587

Wohnort: Ilmenau

Beruf: Student für Mechatronik

  • Private Nachricht senden

9

25.05.2014, 16:30

Du könntest dir auch der einfachheit halber mal ein einfaches Programm schreiben, dem du ein Passwort und einen Dateipfad gibst und es dir dann die Datei öffnet (oder einfach nur sagt, obs geklappt hat). Das machst du dann in einem zweiten Schritt in ein Unterprogramm mit z.B. so einer Signatur:

C-/C++-Quelltext

1
bool OpenZipFile(string Filename, string Password);
und das rufst du dann in deinem BF Programm auf!

->Teil ein großes Problem in Kleinere auf...
Mit freundlichem Gruß
CeDo
Discord: #6996 | Skype: cedomain

Lass solche persönlichen Angriffe lieber bleiben, meine sind härter.

Werbeanzeige