Jump to content
php.lv forumi
Sign in to follow this  
ziedinjsh

Paroles drošība

Recommended Posts

Cik vandījos pa google tad liekas, ka šis ir pietiekami droš lai glabātu paroli

if (defined("CRYPT_BLOWFISH") && CRYPT_BLOWFISH) {
        $salt = '$2y$11$' . substr(md5(uniqid(rand(), true)), 0, 22);
        return crypt($password, $salt);
    }

Share this post


Link to post
Share on other sites

SHA256 + sāls, vismaz 5000 rotācijas.

 

Sāls jau pamatā var būt arī nedroša, jo, well, sāls vienīgais uzdevums ir panākt lai brute būtu jāveic katram ierakstam atsevišķi. 

 

Tomēr, rand/mt_rand nav tas labākais prng, labāk izmantot mcrypt iv vai openssl random bytes... Ja nu nekas tāds nav pieejams, var izmantot prng ar entropy bleach. Vari aizņemties domu no manis (1. funkcija) - http://nopesec.info/posts/wave-pseudo-random-generator

Share this post


Link to post
Share on other sites

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.   Paste as plain text instead

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...