Results 1 to 6 of 6

Thread: What is the HASH Message Digest Framework in PHP?

  1. #1
    Join Date
    Apr 2009
    Posts
    515

    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.!!

  2. #2
    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.

  3. #3
    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.

  4. #4
    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....

  5. #5
    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);
    ?>

  6. #6
    Join Date
    Apr 2008
    Posts
    2,005

    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

Similar Threads

  1. Replies: 10
    Last Post: 05-05-2011, 11:13 AM
  2. Digest authentication in Windows phone 7
    By Viraana in forum Networking & Security
    Replies: 5
    Last Post: 25-01-2011, 05:18 AM
  3. How to create a message digest in java?
    By KADRI in forum Software Development
    Replies: 4
    Last Post: 21-01-2010, 11:00 PM
  4. Replies: 8
    Last Post: 11-07-2009, 02:54 PM
  5. Replies: 8
    Last Post: 16-03-2009, 08:29 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,715,093,119.47237 seconds with 17 queries