All source code in Perl Ask a Perl Pro Discussion Forum Categories All jobs in Perl
MD5,EVERY,mandymakepl,used,with,mandy5pl,Hash
   Code/Articles � |  Newest/Best � |  Community � |  Jobs � |  Other � |  Goto � | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
Perl Stats

 Code: 92,430. lines
 Jobs: 57. postings

 How to support the site

 
Sponsored by:
Quick Search for:  in language:    
You are in:
 
Login





Latest postings for Perl.
There is currently no new code. Please check back soon.
Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!



 
 
   

mandymake.pl

Print
Email
 
VB icon
Submitted on: 2/2/2009 9:24:07 AM
By: David Keaton 
Level: Intermediate
User Rating: Unrated
Compatibility:5.0 (all versions)

Users have accessed this code 2849 times.
 
author picture
(About the author)
 
     mandymake.pl (used with mandy5.pl) is a MD5 Hash making script which creates .txt files that contain tables based on user input as to which type (lowercase, uppercase, numbers only, multiple fields) and the length of the table (if 16 is entered for maximum character length it will generate EVERY possible combination of character type possible.)
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
1) You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.

    =**************************************
    = Name: mandymake.pl
    = Description:mandymake.pl (used with ma
    =     ndy5.pl) is a MD5 Hash making script whi
    =     ch creates .txt files that contain table
    =     s based on user input as to which type (
    =     lowercase, uppercase, numbers only, mult
    =     iple fields) and the length of the table
    =     (if 16 is entered for maximum character 
    =     length it will generate EVERY possible c
    =     ombination of character type possible.)
    = By: David Keaton
    =
    = Inputs:two inputs, which are shifted t
    =     hrough program call.
    ex: perl mandymake.pl -n 16 will create a 16 character long number table.
    (Command reflected in Linux console commands)
    =
    = Returns:The returns are tables created
    =     through the specification of inputs. The
    =     re is no console returns other than the 
    =     notification that the table is done, wha
    =     t type of table it is, and max character
    =     length.
    =
    = Assumes:Main thing, if you do NOT have
    =     a perl interpreter (Linux should be dist
    =     ributed with one, and Windows is more th
    =     an likely not going to have one), you wi
    =     ll have to download it and install it. O
    =     therwise, this script needs no installat
    =     ion, and will run on the fly through a c
    =     md/console command.
    This current code is under testing, and the multi field is a basic compilation. Currently working on converting Multi field into a field that generates lowercase, uppercase, and numbers.
    If you do not know what to enter, leave all arguments blank and execute, their should be an up-to-date-quickie-manual describing basic functions of the script.
    =
    = Side Effects:This program is VERY HDD 
    =     intensive, a 10 character max number tab
    =     le (this generates EVERY possible number
    =     up to 10 characters. 0-9999999999) and t
    =     heir appropriate hash (32 char hex) will
    =     take up >40 gigs. This is intensive j
    =     ust as Rainbow tables would be. Currentl
    =     y working on a way to optimize the size 
    =     of these files.
    =
    =This code is copyrighted and has    = limited warranties.Please see http://w
    =     ww.Planet-Source-Code.com/vb/scripts/Sho
    =     wCode.asp?txtCodeId=794&lngWId=6    =for details.    =**************************************
    
    #!usr/bin/perl
    #this is the table maker for Mandy5
    use Digest::MD5;
    use Switch;
    if (@ARGV < 2){info();}
    #using shift(@ARGV) to get paramaters for how long of a string we reach until we stop the tablemake.
    #using shift@ARGV) to get first parameter of what kinds of tables will be made.
    $state = shift(@ARGV);
    $max = shift(@ARGV);
    $max++;
    #regexp's to check and see if the arguments are what they need to be.
    if ($state !~ m/^-[l|u|m|n|a]/){
    die "\nYou must enter a valid type for flags!\n";
    }
    if ($state =~ m/.{3,}/){
    die "\nYou must enter a valid type for flags!\n";
    }
    if ($max !~ m/\d+/){
    die "\nYou must enter a digit for character length!\n";
    }
    #next lines of code make the MD5 codesets in lowercase.
    switch($state){
    case "-l"		{goto lower;}
    case "-u"		{goto upper;}
    case "-m"		{goto multi;}
    case "-n"		{goto number;}
    case "-a"		{goto lower;}
    case default	{info();}
    }
    lower:
    $lc_let = a;
    #debug info: at this point both variables (lc_let + trans) are being made properly.
    $eax = 0;
    open(MAKELOW,">MD5cmpLower.txt");
    close(MAKELOW);
    while($eax < $max){
    open(MAKELOWER, ">>MD5cmpLower.txt");
    use Digest::MD5 qw(md5_hex);
    $trans = md5_hex($lc_let);
    print MAKELOWER "$lc_let" . ":" . "$trans";
    print MAKELOWER "\n\n";
    $lc_let++;
    close(MAKELOWER);
    $eax = length($lc_let);
    }
    exit unless ($state == "-a");
    #next lines of code make the MD5 Codeset in uppercase...
    upper:
    $up_let = A;
    $eax = 0;
    open(MAKEHIGH, ">MD5cmpUpper.txt");
    close(MAKEHIGH);
    while($eax < $max){
    open(MAKEUPPER, ">>MD5cmpUpper.txt");
    use Digest::MD5 qw(md5_hex);
    $trans = md5_hex($up_let);
    print MAKEUPPER "$up_let" . ":" . "$trans";
    print MAKEUPPER "\n\n";
    $up_let++;
    close(MAKEUPPER);
    $eax = length($up_let);
    }
    exit unless ($state == "-a");
    #next lines of code will make the MD5 Codeset in lowercase with numbers...
    multi:
    $lc_let = a;
    $eax = 0;
    $x = 0;
    open(MAKEMULTI, ">MD5cmpMulti.txt");
    close(MAKEMULTI);
    while($eax < $max){
    open(MAKEMULTI, ">>MD5cmpMulti.txt");
    use Digest::MD5 qw(md5_hex);
    $total = "$lc_let" . "$x";
    $trans = md5_hex($total);
    print MAKEMULTI "$lc_let" . "$x" . ":" . "$trans";
    print MAKEMULTI "\n\n";
    if ($x == 9){
    	$x = 0;
    	$lc_let++;
    	goto pass;}
    $x++;
    pass:
    close(MAKEMULTI);
    $total = "$lc_let" . "$x";
    $eax = length($total);
    }
    exit unless ($state == "-a");
    #next lines of code will make the MD5 Codeset in numbers.
    number:
    $num = 0;
    $eax = 0;
    open(MAKENUMBER, ">MD5cmpNumber.txt");
    close(MAKENUMBER);
    while($eax < $max){
    open(MAKENUMBER, ">>MD5cmpNumber.txt");
    use Digest::MD5 qw(md5_hex);
    $trans = md5_hex($num);
    print MAKENUMBER "$num" . ":" . "$trans";
    print MAKENUMBER "\n\n";
    $num++;
    close(MAKENUMBER);
    $eax = length($num);
    }
    exit unless ($state == "-a");
    print "\n";
    print "\n\nDONE!\n\n";
    $max--;
    print "$max character table made in mode $state =]\n";
    close(MAKELOWER);
    close(MAKEUPPER);
    close(MAKEMULTI);
    close(MAKENUMBER);
    sub info{
    print "\nex: 'perl mandymake.pl a 16' (use for 16 characters using all";
    print "\nmethods)";
    print "\nex: 'perl mandymake.pl n 10' (use only numbers for a 10 character";
    print "\n:table)";
    print "\nflags:";
    print "\n-l	--	make table with only lowercase";
    print "\n-u	--	make table with only uppercase";
    print "\n-m	--	make table with a mixture of alphanumeric";
    print "\n	(last character is number, rest are alpha)";
    print "\n-n	--	make table with only numbers";
    print "\n-a	--	make table with all types (takes the longest)";
    exit;}
    #for use with first case capital, rest lower.
    #need to put this above the iterator -1 EIP
    #open (TEMP, ">temp.txt");
    #print TEMP "$up_let";
    #while (<TEMP>){
    #$regexp =~ m/^.+?:/;
    #}
    #$total = length($regexp);
    #close(TEMP);
    #NOTES:
    #need to make with Capitalization with and without numbers


Other 1 submission(s) by this author

 

 
 Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:
 
Your Vote!

What do you think of this code(in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments

 There are no comments on this submission.
 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author from the email account you registered on the site, so you can correspond directly.

NOTICE: The author of this code has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular code, please click here.
 
To post feedback, first please login.


 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Games | Feedback | Customize | Perl Home | Site Home | Other Sites | Open Letter from Moderators | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright� 1997-2010 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.   Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.