From: Roland Häder Date: Sun, 8 Jun 2008 13:07:25 +0000 (+0000) Subject: Salt length reduced X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2174d8a02c29f20002db0cfecbadadd2923a469a;p=shipsimu.git Salt length reduced --- diff --git a/inc/classes/main/rng/class_RandomNumberGenerator.php b/inc/classes/main/rng/class_RandomNumberGenerator.php index 5856b9e..a8063c6 100644 --- a/inc/classes/main/rng/class_RandomNumberGenerator.php +++ b/inc/classes/main/rng/class_RandomNumberGenerator.php @@ -38,9 +38,9 @@ class RandomNumberGenerator extends BaseFrameworkSystem { private $extraSalt = ""; /** - * Maximum length for salt + * Maximum length for random string */ - private $saltLength = 0; + private $rndStrLen = 0; /** * Private constructor @@ -97,7 +97,7 @@ class RandomNumberGenerator extends BaseFrameworkSystem { $this->extraSalt = sha1(getenv('SERVER_ADDR') . ":" . getenv('SERVER_SOFTWARE') . ":" . $this->getConfigInstance()->readConfig('date_key') . ":" . serialize($this->getDatabaseInstance()->getConnectionData())); // Get config entry for max salt length - $this->saltLength = $this->getConfigInstance()->readConfig('salt_length'); + $this->rndStrLen = $this->getConfigInstance()->readConfig('rnd_str_length'); } /** @@ -108,7 +108,7 @@ class RandomNumberGenerator extends BaseFrameworkSystem { */ public function makeRandomString ($length = -1) { // Is the number <1, then fix it to default length - if ($length < 1) $length = $this->saltLength; + if ($length < 1) $length = $this->rndStrLen; // Initialize the string $randomString = ""; diff --git a/inc/config.php b/inc/config.php index 879c84d..eabfde1 100644 --- a/inc/config.php +++ b/inc/config.php @@ -190,7 +190,10 @@ $cfg->setConfigEntry('math_prime', 591623); $cfg->setConfigEntry('date_key', date("d-m-Y (l-F-T)", time())); // CFG: SALT-LENGTH -$cfg->setConfigEntry('salt_length', 128); +$cfg->setConfigEntry('salt_length', 10); + +// CFG: RND-STR-LENGTH +$cfg->setConfigEntry('rnd_str_length', 128); // [EOF] ?>