X-Git-Url: https://git.mxchange.org/?p=core.git;a=blobdiff_plain;f=inc%2Fclasses%2Fmain%2Frng%2Fclass_RandomNumberGenerator.php;h=27a3672817ce027c31f3cc2203e9b1539805c7a0;hp=fd416433a52d49f55495d12fc8456d27ca92306c;hb=5e067e1139ac4c4ec92642b8700b449d756e01ec;hpb=1fefb1935bf65d6a5efd241538e2e7679d480afe diff --git a/inc/classes/main/rng/class_RandomNumberGenerator.php b/inc/classes/main/rng/class_RandomNumberGenerator.php index fd416433..27a36728 100644 --- a/inc/classes/main/rng/class_RandomNumberGenerator.php +++ b/inc/classes/main/rng/class_RandomNumberGenerator.php @@ -174,6 +174,24 @@ class RandomNumberGenerator extends BaseFrameworkSystem { public final function getFixedSalt () { return $this->fixedSalt; } + + /** + * Generates a key based on if we have extra (default) or fixed salt enabled + * + * @return $key The generated key for encrypion + */ + public function generateKey () { + // Default is extra salt + $key = md5($this->getExtraSalt()); + + // Get key + if ($this->getConfigInstance()->getConfigEntry('crypt_fixed_salt') == 'Y') { + $key = md5($this->getFixedSalt()); + } // END - if + + // Return it + return $key; + } } // [EOF]