EG Information
Training Missions
Knowledge Bank
|
|
Enigma Group's Code Bank
passGeneratorBy: ruokblah - Date Submitted: 2009-12-17 13:20:59 [main.cpp] #include <iostream> #include <fstream> #include "brutePass.h" using namespace std; int main() { ofstream outPut; brutePass passwd; outPut.open("passList.txt"); while(passwd.getLength() <= 5){ outPut<<passwd.getNext()<<endl; } //This will generate all passwords [a-z][A-Z][0-9] 1-5 chars //in length and save them to passList.txt cout<<endl; system("pause"); return 0; } [brutePass.h] /** *Comments only encurrage people *not to understand the code... *Coded by ruok?! */ #include <string> using namespace::std; class brutePass{ public: brutePass(); void setStart(string); string getNext(); string getCurrent(); int getLength(); private: string currentPass; string all; }; [brutePass.cpp] /** *Comments only encurrage people *not to understand the code... *Coded by ruok?! */ #include "brutePass.h" brutePass::brutePass(){ currentPass=""; all="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; } void brutePass::setStart(string k){ currentPass=k; } std::string brutePass::getNext(){ int aL = all.length() - 1; int cpL; for(cpL = currentPass.length() - 1; cpL >= 0; cpL--){ if(currentPass[cpL] == all[aL]){ currentPass.replace(cpL, 1, all.substr(0,1)); } else{ currentPass.replace(cpL, 1, all.substr(all.find(currentPass.substr(cpL,1)) + 1,1)); cpL = -2; } } if(cpL == -1){ currentPass = all.substr(0,1) + currentPass; } return currentPass; } std::string brutePass::getCurrent(){ return currentPass; } int brutePass::getLength(){ return currentPass.length(); }
|
| Return to
cpp category list |
|
|
Who's Online
484 Guests, 100 Users ckryptix, rabbidmind, asapong, Nasrudin, Diznablo, CollapsingWalls, mehtaparag, bitstrike, jnony, C, Nicid1, Nusquam-Redono-Sapientia, bazcrown, saifulfaizan, The End, Ultraminor, psychomarine, st3alth, themastersinner, pgmrlink, login, lionaneesh, ishkur88, mahraja, Mac, chekifr, gandalf88, Vap0r, t0ast, tantrum6226, BnE, Distorted, Psiber_Syn, Ausome1, invas10n, oldgoat, freedaysbecumei, BinaryShinigami, Rex_Mundi, Red_beard, Strobeflux, s0m3nak3dguy, Descent, teehee, machupicchu, Genetix, Anandarl, NotMyOwn, thegamerdude, Godzila, popo12341234, RedEvolution, velocity_b, myne17, teto111, aVoid, Central-Gsm, 1101, JackalReborn, InjectioN, h4lted, c0re, DisPater, markt4death, splatta, Jackowacko, saint556, Pyron2312, Azerion, howsens, white.hat.gone.bad, vazzilly, pwunkz, Ios, Inverted, QuarterCask, Infernoe11, deskata, cr4ck3rj4ck, Blizer, jasonmax, j0sh, gwenwavor, N4g4c3N, spizeyboy, Network X, Uino59, Jae Cee, ianFDK, saykov, medhaavee, zofy, demonkiller410, Stumble, SaMTHG, kishore, Raze, helasraizam, Venom1019, Jakabo |
| |
|
|
|
|
|