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

Commit 17b764e

Browse files
committed
Use fixed salt for key
1 parent 0dd9176 commit 17b764e

File tree

1 file changed

+2
-3
lines changed
  • core/src/core/src/pydio/Core/Utils/Crypto

1 file changed

+2
-3
lines changed

core/src/core/src/pydio/Core/Utils/Crypto/Key.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ class Key
4343
* @param null $options
4444
* @return array|bool|string
4545
*/
46-
public static function create($password, $strength = Key::STRENGTH_LOW, $options = null){
46+
public static function create($password, $strength = Key::STRENGTH_MEDIUM, $options = null){
4747

4848
if(!$options){
4949
$options = array(
5050
"strength" => self::STRENGTH_MEDIUM,
5151
"size" => self::SIZE_256,
5252
"iterations" => 20000,
53-
"salt" => Crypto::getRandomSalt(self::SIZE_256),
53+
"salt" => md5(Crypto::getApplicationSecret()),
5454
"hash_function" => "SHA512"
5555
);
5656
}
@@ -84,7 +84,6 @@ public static function create($password, $strength = Key::STRENGTH_LOW, $options
8484

8585
} else if($strength == self::STRENGTH_LOW){
8686
return substr(hash($options["hash_function"], $password), 0, $options["size"]);
87-
8887
} else {
8988
return openssl_pbkdf2($password, $options["salt"], $options["size"], $options["iterations"], $options["hash_function"]);
9089
}

0 commit comments

Comments
 (0)