diff options
author | Scott Arciszewski <scott@arciszewski.me> | 2014-03-19 13:31:51 -0400 |
---|---|---|
committer | Scott Arciszewski <scott@arciszewski.me> | 2014-03-19 13:31:51 -0400 |
commit | 36da3bc35908d9324397ba5fac5f2a4228bea51e (patch) | |
tree | 004a0f36f03ccc226db9452f3db172ca436cbad8 /apps | |
parent | 6252c248c23661beef6484cf1ffa24db406e28ae (diff) | |
download | nextcloud-server-36da3bc35908d9324397ba5fac5f2a4228bea51e.tar.gz nextcloud-server-36da3bc35908d9324397ba5fac5f2a4228bea51e.zip |
Update crypt.php
A 1024 kilobyte key would be obnoxiously slow to operate on. I'm assuming you meant 1024-bit?
Also, 183 bytes = 1464 bits.
Here's a safe alternative: 2048 bits, with comment-code sanity
Diffstat (limited to 'apps')
-rwxr-xr-x | apps/files_encryption/lib/crypt.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/files_encryption/lib/crypt.php b/apps/files_encryption/lib/crypt.php index caca13acece..e38a4ef7125 100755 --- a/apps/files_encryption/lib/crypt.php +++ b/apps/files_encryption/lib/crypt.php @@ -497,13 +497,13 @@ class Crypt { }
/**
- * @brief Generate a pseudo random 1024kb ASCII key, used as file key
+ * @brief Generate a pseudo random 2048-bit ASCII key, used as file key
* @returns $key Generated key
*/
public static function generateKey() {
// Generate key
- if ($key = base64_encode(openssl_random_pseudo_bytes(183, $strong))) {
+ if ($key = base64_encode(openssl_random_pseudo_bytes(256, $strong))) {
if (!$strong) {
|