namespace Org\Mxchange\CoreFramework\Helper\Crypto;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Crypto\Cryptable;
use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
$randomString = $this->getRngInstance()->randomString() . $this->createUuid();
// Get config entry for salt length
- $length = $this->getConfigInstance()->getConfigEntry('salt_length');
+ $length = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('salt_length');
// Keep only defined number of characters
$this->salt = substr(sha1($randomString), -$length, $length);
$uuid = '';
// Is the UUID extension loaded and enabled? (see pecl)
- if ($this->getConfigInstance()->getConfigEntry('extension_uuid_loaded') === true) {
+ if (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('extension_uuid_loaded') === true) {
// Then add it as well
$uuid = uuid_create();
} // END - if
// Is the old password set?
if (!empty($oldHash)) {
// Use the salt from hash, first get length
- $length = $this->getConfigInstance()->getConfigEntry('salt_length');
+ $length = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('salt_length');
// Then extract the X first characters from the hash as our salt
$salt = substr($oldHash, 0, $length);
//* DEBUG: */ echo "salt=".$salt."/plain=".$str."<br />\n";
if ($withFixed === true) {
// Use additional fixed salt
- $hashed = $salt . md5(sprintf($this->getConfigInstance()->getConfigEntry('hash_extra_mask'),
+ $hashed = $salt . md5(sprintf(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('hash_extra_mask'),
$salt,
$this->getRngInstance()->getFixedSalt(),
$str
));
} else {
// Use salt+string to hash
- $hashed = $salt . md5(sprintf($this->getConfigInstance()->getConfigEntry('hash_normal_mask'),
+ $hashed = $salt . md5(sprintf(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('hash_normal_mask'),
$salt,
$str
));