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
This commit is contained in:
Scott Arciszewski 2014-03-19 13:31:51 -04:00
parent 6252c248c2
commit 36da3bc359
1 changed files with 2 additions and 2 deletions

View File

@ -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 * @returns $key Generated key
*/ */
public static function generateKey() { public static function generateKey() {
// Generate key // Generate key
if ($key = base64_encode(openssl_random_pseudo_bytes(183, $strong))) { if ($key = base64_encode(openssl_random_pseudo_bytes(256, $strong))) {
if (!$strong) { if (!$strong) {