Jump to content

MD5 problems


OuisVN

Recommended Posts

I need help :(

 

i need remove all md5 and others hashings in this codes

 

Validate: http://pastebin.com/wLENt5df

 

and Register/Login: http://pastebin.com/gG0fK7ys

 

 

In register/login i remove md5

 

$loginKey = md5(time() . json_encode($_POST)); to $loginKey = time() . json_encode($_POST); AND 'password' => $mysql->hash($_POST['pass']), to 'password' => $mysql->$_POST['pass'],

 

but i need remove md5 in validate, please help me

Link to comment
Share on other sites

  1. static function hash($str, $rawsalt = '', $hash = 'sha512')

  2.         {

                if($rawsalt == '')

                {

                        $rawsalt = self::rand(((strlen($str) % 3) + 1) * 5);

                }

               

                $loc = array(hash('sha1', $rawsalt), hash('sha1', $str), '');

                foreach(str_split($loc[0], 1) as $index => $character)

                {

                        $loc[2] .= $character . $loc[1][$index];

                }

               

                $hash = hash($hash, $loc[2]);

                return substr_replace($hash, $rawsalt, (strlen($str) << 2) % strlen($hash), 0);

        }

       

        static function validate($str, $hash, $engine = 'sha512')

        {

                $salt = substr($hash, (strlen($str) << 2) % strlen(hash($engine, 1)), ((strlen($str) % 3) + 1) * 5);

                return self::hash($str, $salt, $engine) === $hash ? true : false;

        }

 

 

 

I need remove hash, sha512, md5 and other hashings without damage code

 

Link to comment
Share on other sites

If these are user passwords to a site where the login is an email address w/ password, then there really is no harm in deleting everyone's password as long as there is a password reset feature. You'd really want to enforce the new stronger passwords anyway.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.