No such thing as a small change | |
PerlMonks |
Re: Re: Re: Passing data from one script to anotherby hardburn (Abbot) |
on May 02, 2003 at 16:09 UTC ( [id://255059]=note: print w/replies, xml ) | Need Help?? |
Like this:
But for anything new, you should be using SHA1 (as MD5 is quite possibly on its deathbed as far as security applications go), which is done like this:
Unfortunately, Digest::SHA1 doesn't come with Perl by default (the MD5 module does). Better still, you can use simply Digest with an OO interface to specify the hash algorithm at runtime. IMHO, its important to be able to switch from one crypto/hash algorithm to another on a moment's notice, in case your current algorithm turns out to have a catastrophic security hole. The Digest.pm module helps you to do that change. Here's how to use it:
The OO interface in the Digest.pm module is basically the same as the interface in the Digest::MD5 and Digest::SHA1 modules (I used the functional interface for those modules above, for simplicity's sake). ---- Note: All code is untested, unless otherwise stated
In Section
Seekers of Perl Wisdom
|
|