Permalink
Browse files

Use fixed salt for key

  • Loading branch information...
1 parent 0dd9176 commit 17b764ef9b8684a2bfbacec8666192914c10d94f @cdujeu cdujeu committed Sep 27, 2016
Showing with 2 additions and 3 deletions.
  1. +2 −3 core/src/core/src/pydio/Core/Utils/Crypto/Key.php
@@ -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"
);
}
@@ -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"]);
}

0 comments on commit 17b764e

Please sign in to comment.