Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Use fixed salt for key
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Sep 27, 2016
1 parent 0dd9176 commit 17b764e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions core/src/core/src/pydio/Core/Utils/Crypto/Key.php
Expand Up @@ -43,14 +43,14 @@ class Key
* @param null $options
* @return array|bool|string
*/
public static function create($password, $strength = Key::STRENGTH_LOW, $options = null){
public static function create($password, $strength = Key::STRENGTH_MEDIUM, $options = null){

if(!$options){
$options = array(
"strength" => self::STRENGTH_MEDIUM,
"size" => self::SIZE_256,
"iterations" => 20000,
"salt" => Crypto::getRandomSalt(self::SIZE_256),
"salt" => md5(Crypto::getApplicationSecret()),
"hash_function" => "SHA512"
);
}
Expand Down Expand Up @@ -84,7 +84,6 @@ public static function create($password, $strength = Key::STRENGTH_LOW, $options

} else if($strength == self::STRENGTH_LOW){
return substr(hash($options["hash_function"], $password), 0, $options["size"]);

} else {
return openssl_pbkdf2($password, $options["salt"], $options["size"], $options["iterations"], $options["hash_function"]);
}
Expand Down

0 comments on commit 17b764e

Please sign in to comment.