Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



What is the HASH Message Digest Framework in PHP?

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 07-03-2010
Member
 
Join Date: Apr 2009
Posts: 511
What is the HASH Message Digest Framework in PHP?
  

Hi everyone,
I am learning an advanced topics in PHP programming language. Now I am doing the Cryptography Extensions in PHP. In that I am not able to understand the HASH, which is the message digest framework in PHP? So I am posting here my query, so that I can get needful help from you guys.!! Please explain me what is the HASH Message Digest Framework in PHP? Any other information about the HASH would be grateful.!!

Reply With Quote
  #2  
Old 07-03-2010
Member
 
Join Date: Mar 2008
Posts: 672
Re: What is the HASH Message Digest Framework in PHP?

The HASH is like an engine thumbprint. Allows direct or incremental processing of arbitrary size message using a variety of algorithms. The Hash extension requires no external libraries and is enabled by default since PHP 5.1.2. It must be explicitly disabled at compile time with - disable-hash. For older versions of PHP, you must install the "module PECL extension to use the Hash. HASH Message Digest Framework does the Native implementations of common message digest algorithms using a generic factory method.
Reply With Quote
  #3  
Old 07-03-2010
Member
 
Join Date: Aug 2006
Posts: 227
Re: What is the HASH Message Digest Framework in PHP?

There is no installation needed to use these functions, they are part of the PHP core. You should keep in mind that this extension does not define any configuration directive. This extension defines one resource Hash of context returned by hash_init (). The function hash_init initialize an incremental hashing context. The following is a description for the same :
Code:
hash_init resource (string $ algo [, int $ options = 0 [, string $ key = NULL]])
__________________
I do to dead flowers what people at morgues do to dead people. Suck all the moisture out, dip them in plastic, paint them up pretty and put them in a nice frame.
Reply With Quote
  #4  
Old 07-03-2010
Member
 
Join Date: Jul 2006
Posts: 286
Re: What is the HASH Message Digest Framework in PHP?

Even I would like to discuss on the hash_init. The hash_init can take the following parameters :
  1. algo - Name of selected hashing algorithm.
  2. Options - Optional configurations for generating the hash, currently supports only one option: HASH_HMAC. When this option is specified, the key must be specified.
  3. key - When HASH_HMAC is specified for options, a shared secret key to be used with the HMAC hash method must be provided in this setting.
Returns a hash of context for use with hash_update (), hash_update_stream (), hash_update_file () and hash_final ().
__________________
IF you hate me, please don't mention it. I know who hates me and who doesn't. You really do not have to make fun of people....
Reply With Quote
  #5  
Old 07-03-2010
Member
 
Join Date: Nov 2008
Posts: 1,192
Re: What is the HASH Message Digest Framework in PHP?

I have given you an example of incremental hashing. Hope that you can understand much better after looking at the example given below :
PHP Code:
<?php
$ctx 
hash_init('md3');
hash_update($ctx'This is  ');
hash_update($ctx'an example.');
echo 
hash_final($ctx);
?>
Reply With Quote
  #6  
Old 07-03-2010
Member
 
Join Date: Apr 2008
Posts: 2,001
Re: What is the HASH Message Digest Framework in PHP?

The following is the list of the Hash Functions with their descriptions :
  • hash_algos - Returns a list of registered hashing algorithms
  • hash_copy - Copy hashing context
  • hash_file - Generate a hash value using the contents of a given file
  • hash_final - Finalize an incremental hash and return the result of the fingerprint
  • hash_hmac_file - Generates a key value hash using the HMAC method and content of a given file
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "What is the HASH Message Digest Framework in PHP?"
Thread Thread Starter Forum Replies Last Post
.NET Framework 3.5 Service Pack 1 and .NET Framework 3.5 Family Update (KB951847) x86 M.Scarlet Server Update Service 10 05-05-2011 11:13 AM
Digest authentication in Windows phone 7 Viraana Networking & Security 5 25-01-2011 05:18 AM
How to create a message digest in java? KADRI Software Development 4 21-01-2010 11:00 PM
Update to .NET Framework 3.5 Service Pack 1 for the .NET Framework Assistant 1.0 x86 (KB963707) t-4-2 Windows Update 8 11-07-2009 02:54 PM
Microsoft .NET Framework 3.5 Service Pack 1 and .NET Framework 3.5 Family Update (KB951847) x64 Installation problem BP Windows Update 8 16-03-2009 08:29 AM


All times are GMT +5.5. The time now is 03:45 PM.