diff options
-rw-r--r-- | apps/encryption/lib/crypto/crypt.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/apps/encryption/lib/crypto/crypt.php b/apps/encryption/lib/crypto/crypt.php index f27f55619af..790541bc07d 100644 --- a/apps/encryption/lib/crypto/crypt.php +++ b/apps/encryption/lib/crypto/crypt.php @@ -475,6 +475,7 @@ class Crypt { * @return string */ private function createSignature($data, $passPhrase) { + $passPhrase = hash('sha512', $passPhrase . 'a', true); $signature = hash_hmac('sha256', $data, $passPhrase); return $signature; } @@ -607,14 +608,14 @@ class Crypt { } /** - * Generate a cryptographically secure pseudo-random base64 encoded 256-bit - * ASCII key, used as file key + * Generate a cryptographically secure pseudo-random 256-bit ASCII key, used + * as file key * * @return string * @throws \Exception */ public function generateFileKey() { - return base64_encode(random_bytes(32)); + return random_bytes(32); } /** |