Results 1 to 3 of 3

Thread: Convert user input field to MD5

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2010
    Posts
    137

    Convert user input field to MD5

    hi all
    i want to convert the user input field to MD5 Algorithm
    can anyone help me thx in advance

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Convert user input field to MD5

    You might try looking for yourself before asking. Most things have been done before and there are tons of examples on the web. If you can't find what you need then that's something else, but you should at least look.

    http://www.google.com.au/search?q=md...ient=firefox-a
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Aug 2010
    Posts
    137

    Re: Convert user input field to MD5

    I founnd thr encryption code i wanted but in php how to convert to vb.net
    Code:
    function phpbb_hash($password) 
    { 
        $itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; 
    
        $random_state = unique_id(); 
        $random = ''; 
        $count = 6; 
    
        if (($fh = @fopen('/dev/urandom', 'rb'))) 
        { 
            $random = fread($fh, $count); 
            fclose($fh); 
        } 
    
    &#160;&#160;&#160;&#160;if&#160;(strlen($random)&#160;<&#160;$count) 
    &#160;&#160;&#160;&#160;{ 
    &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;$random&#160;=&#160;''; 
    
    &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;for&#160;($i&#160;=&#160;0;&#160;$i&#160;<&#160;$count;&#160;$i&#160;+=&#160;16) 
    &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{ 
    &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;$random_state&#160;=&#160;md5(unique_id()&#160;.&#160;$random_state); 
    &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;$random&#160;.=&#160;pack('H*',&#160;md5($random_state)); 
    &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;} 
    &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;$random&#160;=&#160;substr($random,&#160;0,&#160;$count); 
    &#160;&#160;&#160;&#160;} 
    
    &#160;&#160;&#160;&#160;$hash&#160;=&#160;_hash_crypt_private($password,&#160;_hash_gensalt_private($random,&#160;$itoa64),&#160;$itoa64); 
    
    &#160;&#160;&#160;&#160;if&#160;(strlen($hash)&#160;==&#160;34) 
    &#160;&#160;&#160;&#160;{ 
    &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;return&#160;$hash; 
    &#160;&#160;&#160;&#160;} 
    
    &#160;&#160;&#160;&#160;return&#160;md5($password); 
    }&#160;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width