| @@ 66-73 (lines=8) @@ | ||
| 63 | public function hash($password) { |
|
| 64 | $random = ''; |
|
| 65 | ||
| 66 | if (CRYPT_BLOWFISH == 1 && ($this->hashMethod & self::HASH_BLOWFISH)) { |
|
| 67 | $random = $this->getRandomBytes(16); |
|
| 68 | $hash = |
|
| 69 | crypt($password, $this->gensaltBlowfish($random)); |
|
| 70 | if (strlen($hash) == 60) { |
|
| 71 | return $hash; |
|
| 72 | } |
|
| 73 | } |
|
| 74 | ||
| 75 | if (CRYPT_EXT_DES == 1 && ($this->hashMethod & self::HASH_EXTDES)) { |
|
| 76 | if (strlen($random) < 3) { |
|
| @@ 75-84 (lines=10) @@ | ||
| 72 | } |
|
| 73 | } |
|
| 74 | ||
| 75 | if (CRYPT_EXT_DES == 1 && ($this->hashMethod & self::HASH_EXTDES)) { |
|
| 76 | if (strlen($random) < 3) { |
|
| 77 | $random = $this->getRandomBytes(3); |
|
| 78 | } |
|
| 79 | $hash = |
|
| 80 | crypt($password, $this->gensaltExtended($random)); |
|
| 81 | if (strlen($hash) == 20) { |
|
| 82 | return $hash; |
|
| 83 | } |
|
| 84 | } |
|
| 85 | ||
| 86 | if (strlen($random) < 6) { |
|
| 87 | $random = $this->getRandomBytes(6); |
|