Latest 100 public
snipts » md5
showing 1-4 of 4 snipts for md5
-
∞ create and print SHA1 and MD5 hashes of passwords
Perl code to create and print SHA1 and MD5 hashes of passwords #!/usr/bin/perl -I /usr/lib/perl5/site_perl/5.005/i386-linux # Perl code to create and print SHA1 and MD5 hashes of passwords # shamelessly stolen from the openLDAP Faq-O-Matic # written 19-Jul-01 by Ed Truitt # Updated 12-Oct-01 to include a {crypt} version of the password $theGoodWord = $ARGV[0]; chomp($theGoodWord); # First, print the clear text version print "\n" ; print "The Good Word is ==> $theGoodWord \n " ; print "\n" ; # Now generate and print the SHA1 hash use Digest::SHA1; use MIME::Base64; $ctx = Digest::SHA1->new; $ctx->add($theGoodWord); $hashedSHAPasswd = '{SHA}' . encode_base64($ctx->digest,''); print 'userPassword: ' . $hashedSHAPasswd . "\n"; # Now generate and print the MD5 hash use Digest::MD5; use MIME::Base64; $ctx = Digest::MD5->new; $ctx->add($theGoodWord); $hashedMD5Passwd = '{MD5}' . encode_base64($ctx->digest,''); print 'userPassword: ' . $hashedMD5Passwd . "\n"; # Now generate and print the CRYPT version # first we need to generate the salt @chars = ("A" .. "Z", "a" .. "z", 0 .. 9, qw(. /) ); $salt = join("", @chars[ map { rand @chars} ( 1 .. 4) ]); # now to generate the password itself $cryptPasswd = '{crypt}' . crypt($theGoodWord,$salt); print 'userPassword: ' . $cryptPasswd . "\n"; print "\n"; -
∞ random md5
md5(uniqid(rand(), true)); -
∞ Encrypt a password with a two-level md5 application and some letter swapping. It has no decrypter
<?php function encriptar($contrasena) { $max = strlen($contrasena); $numero = floor(sqrt($max*2)); for($i=0;$i<$numero;$i++) { $temp = $contrasena[$i]; $contrasena[$i] = $contrasena[$max - $i - 1]; $contrasena[$max - $i - 1] = $temp; } $niveluno = md5($contrasena); $max2 = strlen($niveluno); if($numero>($max2-1)) { $numero = $max/2 - 1; } for($i=0;$i<$numero;$i++) { $temp = $niveluno[$i]; $niveluno[$i] = $niveluno[$max2 - $i - 1]; $niveluno[$max2 - $i - 1] = $temp; } $niveldos = md5($niveluno); return $niveldos; } ?>
-
∞ MD5 MySQL
insert into usuarios(usuario,nombres,apellidos,passwd) values('bond','James','Bond',md5('administrador'));


