EG Information
Training Missions
Knowledge Bank
|
|
Enigma Group's Code Bank
passwd.plBy: toast - Date Submitted: 2009-05-17 04:49:09 #=======================================================================================# # Written by: Toast # # # # Name : passwdgen.pl # # # # Random password generator will let the user choose how long the passwd will be if not # # specified it will default to 10 characters # # # # It will also print the MD5 Hash and SHA1 Hash of the password # # # # Written under Slackware 12.2 tested and working # #=======================================================================================# use strict; use warnings; use Digest ::MD5 qw(md5_hex ); use Digest ::SHA1 qw(sha1_hex ); my $passwd; my $rand; # Password Length my $passwd_length = $ARGV[0] ; if (!$passwd_length ) { $passwd_length = 10; } # Characters that will be used to generate the random password my @chars = split ( " ", "q w e r t y u i o p a s d f g h j k l z x c v b n m Q W E R T Y U I O P A S D F G H J K L Z X C V B N M 1 2 3 4 5 6 7 8 9 0 ! @ $ % ^ & # * ( ) + - = | / < > ~ ` : ; [ ] { } | , . ? _") ; for (my $i=0; $i<$passwd_length ;$i++) { $passwd .= $chars[$rand]; } # Prints the generated password to the screen print "Your new password is: $passwdn"; # Hashes the password to MD5 and print to screen. my $md5_hash = md5_hex($passwd); print "The MD5 Hash is: $md5_hashn"; # Hashes the password to SHA1 and prints to the screen. my $sha1_hash = sha1_hex($passwd); print "The SHA1 Hash is: $sha1_hashn";
|
| Return to
perl category list |
|
|
Who's Online
483 Guests, 101 Users ckryptix, Ios, viper0i0, Diznablo, rabbidmind, asapong, Nasrudin, 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, 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 |
| |
|
|
|
|
|