Crypt_Hash
[ class tree: Crypt_Hash ] [ index: Crypt_Hash ] [ all elements ]

Procedural File: Hash.php

Source Location: /lib/3rdParty/phpseclib/Crypt/Hash.php



Classes:

Crypt_Hash
Pure-PHP implementations of keyed-hash message authentication codes (HMACs) and various cryptographic hashing functions.


Page Details:

Pure-PHP implementations of keyed-hash message authentication codes (HMACs) and various cryptographic hashing functions.

Uses hash() or mhash() if available and an internal implementation, otherwise. Currently supports the following:

md2, md5, md5-96, sha1, sha1-96, sha256, sha384, and sha512

If setKey() is called, hash() will return the HMAC as opposed to the hash. If no valid algorithm is provided, sha1 will be used.

PHP versions 4 and 5

Here's a short example of how to use this library:

  1.  <?php
  2.     include('Crypt/Hash.php');
  3.  
  4.     $hash new Crypt_Hash('sha1');
  5.  
  6.     $hash->setKey('abcdefg');
  7.  
  8.     echo base64_encode($hash->hash('abcdefg'));
  9.  ?>

LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA




Tags:

author:  Jim Wigginton <terrafrost@php.net>
version:  $Id: Hash.php,v 1.1 2010/05/14 14:06:16 gruberroland Exp $
copyright:  MMVII Jim Wigginton
link:  http://phpseclib.sourceforge.net
license:  http://www.gnu.org/licenses/lgpl.txt








Documentation generated on Fri, 25 Jun 2010 18:49:07 +0200 by phpDocumentor 1.4.1