RFC: Message digest hashing and HMAC classes
| From: | Jesus M. Castagnetto | Date: | Fri, 27 Sep 2002 00:34:12 +0000 |
| Subject: | RFC: Message digest hashing and HMAC classes | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-9575@lists.php.net to get a copy of this message | ||
I was playing with the mhash lib (just installed it), and as luck will have it
I got the September issue of the "Linux Magazine", read the articles, hit
google, etc.
To make a long story short, I made some simple wrappers that use the mhash
functions to generate message digests (aka hashes), as well as HMACs.
Take a look at the code at:
http://www.scripps.edu/~jesusmc/stuff/Digest-0.0.1.tgz
That code is barely commented, but it is simple enough so it may not need to be
for now. The main class is the Digest class, and can be used to generate hash
or HMAC objects, or can be used via call to its static methods.
For those who like the cool pear installer (like I do), use:
pear install http://www.scripps.edu/~jesusmc/stuff/Digest-0.0.1.tgz
You can see some examples of use in the file:
Digest/misc/testdigest.php
You'll find in the 'misc' dir a simple class to generate all the wrappers for
the hashes. I tested the code w/ mhash 0.8.16.
If there is interest I'll put the package in PEAR. Name suggestions for classes
(as well as for methods) are welcomed.
=====
--- Jesus M. Castagnetto (jcastagnetto@yahoo.com)
Research:
http://metallo.scripps.edu/
Personal: http://www.castagnetto.org/
__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com