[Melbourne-pm] OT[sort of] plain hashing text passwords
david.warring at gmail.com
Wed Oct 7 21:35:27 PDT 2009
This is better, but still open to compromise.
The problem is that the hashing is predictable. Weaker to medium strength
passwords can be fairly easily discovered, considered:
$password = "hello";
This produces: aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d
Try googling this! You'll see pages of matches for the hex string, from
which you can originally discover the original password.
This type of attack can be thwarted by salting the password, ie prepending
some random characters to both the input string and output digest:
See http://www.perlmonks.org/index.pl?node_id=469789 for an example that
combines SHA digests with salting.
On Thu, Oct 8, 2009 at 2:10 PM, Toby Wintermute <tjc at wintrmute.net> wrote:
> 2009/10/8 John Thornton <jdthornton at ozemail.com.au>:
> > So, does anyone here know how to
> > hash/encrypt/disguise passwords that are in plain text, as the password
> > on my computer in the .yml file.
> use Digest::SHA;
> my $password = "secret_password";
> my $sha = Digest::SHA->new;
> print "My hashed result is: " . $sha->hexdigest ."\n";
> Melbourne-pm mailing list
> Melbourne-pm at pm.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Melbourne-pm