Results 1 to 6 of 6

Thread: What is the Mhash in PHP?

  1. #1
    Join Date
    Aug 2006
    Posts
    201

    What is the Mhash in PHP?

    Hello friends,
    I have done the basic things that are required for PHP programming language. Now I am studying about the extensions that are used for a cryptography. In that I have not understood about the Mhash, so thought to take some help from you guys.!! Please tell me what is the Mhash in PHP? Thanks in Advance.!!
    Don't be afraid of darkness, it's in your heart anyway.

  2. #2
    Join Date
    Jul 2006
    Posts
    289

    Re: What is the Mhash in PHP?

    These functions are intended to work with "mhash. Mhash can be used to create a checksum, hash and more. This set of functions is an interface to the mhash library. Mhash accepts many different algorithms, like MD5, SHA1, GOST, and many others. For a complete list of supported hashes, refer to the documentation of mhash. The general rule is that you can access an algorithm from PHP with constant MHASH_HASHNAME. For example, to access TIGER algorithm, you can use the constant MHASH_TIGER. This extension is obsolete. Please use the extension Hash instead.
    Signatures reduce available bandwidth

  3. #3
    Join Date
    Aug 2006
    Posts
    235

    Re: What is the Mhash in PHP?

    You will need to compile PHP with - with-mhash [= DIR] to enable this extension. DIR is the installation folder for the mhash library. Since PHP 5.3.0, mhash extension is emulated through extension Hash. Also, the option to specify the installation folder mhash has no effect, and this extension requires the installation of the extension for hash function. DIR is not the installation directory, it is the directory that contains the compiled source files. You should keep in mind that this extension does not define any configuration directive.
    3.2 (northwood)
    2gig ram
    ATI AIW X800xt 256mb
    Gigabyte GA-8knxp 875p Chipset
    Optiwrite 8X DVD Burner
    Win XP PRO Sp2 (Works Perfectly)
    2 SATA Raptor 74gig Raid 0
    2 7200 IDE 320gig HD

  4. #4
    Join Date
    Mar 2008
    Posts
    672

    Re: What is the Mhash in PHP?

    The following are the Predefined Constants which are defined by this extension, and are only available when the extension has been compiled into PHP or dynamically loaded at runtime. Here is a list of modes that are supported by mhash :
    • MHASH_ADLER32
    • MHASH_CRC32
    • MHASH_CRC32B
    • MHASH_GOST
    • MHASH_HAVAL128
    • MHASH_HAVAL160
    • MHASH_HAVAL192
    • MHASH_HAVAL256
    • MHASH_MD4
    • MHASH_MD5

  5. #5
    Join Date
    Oct 2005
    Posts
    2,393

    Re: What is the Mhash in PHP?

    I am providing you the Mhash Functions, that can be very useful while doing the coding :
    • mhash_count - Get the maximum hash identifier
    • mhash_get_block_size - Returns the blocksize of the hash
    • mhash_get_hash_name - Returns the name of the hash
    • mhash_keygen_s2k - Generates a key
    • mhash - Compute hash

  6. #6
    Join Date
    Nov 2008
    Posts
    996

    Re: What is the Mhash in PHP?

    The following is an example of the computing the MD5 digest and hmac, and also prints it out as Hex :
    PHP Code:
    <?php
    $input 
    "So what are you doing?";
    $hash mhash(MHASH_MD5$input);
    echo 
    "The hash is " bin2hex($hash) . "<br />\n";
    $hash mhash(MHASH_MD5$input"Jefe");
    echo 
    "The hmac is " bin2hex($hash) . "<br />\n";
    ?>

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,713,556,956.76723 seconds with 16 queries