use Org\Mxchange\CoreFramework\Database\Frontend\User\UserDatabaseFrontend;
use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
+use Org\Mxchange\CoreFramework\Helper\Crypto\CryptoHelper;
use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
use Org\Mxchange\CoreFramework\Request\Requestable;
use Org\Mxchange\CoreFramework\Resolver\Command\CommandResolver;
$randomString = $rngInstance->randomString(255);
// Get a crypto instance
- $cryptoInstance = ObjectFactory::createObjectByConfiguredName('crypto_class');
+ $cryptoInstance = CryptoHelper::getSelfInstance();
// Hash and encrypt the string
$hashedString = $cryptoInstance->hashString($cryptoInstance->encryptString($randomString));
$encryptDecoded = base64_decode(str_replace(' ', '+', urldecode($encryptRequest)));
// Get a crypto helper and decrypt the string
- $decryptedString = ObjectFactory::createObjectByConfiguredName('crypto_class')->decryptString($encryptDecoded);
+ $decryptedString = CryptoHelper::getSelfInstance()->decryptString($encryptDecoded);
// Is it the expected length?
if (strlen($decryptedString) != FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('captcha_string_length')) {
use Org\Mxchange\CoreFramework\Filter\Chain\FilterChainException;
use Org\Mxchange\CoreFramework\Filter\Filterable;
use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
+use Org\Mxchange\CoreFramework\Helper\Crypto\CryptoHelper;
use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
use Org\Mxchange\CoreFramework\Request\Requestable;
use Org\Mxchange\CoreFramework\Response\Responseable;
$currentHash = $userInstance->getField('pass_hash');
// Get an encryption helper and encrypt the password
- $passHash = ObjectFactory::createObjectByConfiguredName('crypto_class')->hashString($password, $currentHash);
+ $passHash = CryptoHelper::getSelfInstance()->hashString($password, $currentHash);
// Does it match?
if ($currentHash != $passHash) {
use Org\Mxchange\CoreFramework\Filter\BaseFilter;
use Org\Mxchange\CoreFramework\Filter\Chain\FilterChainException;
use Org\Mxchange\CoreFramework\Filter\Filterable;
+use Org\Mxchange\CoreFramework\Helper\Crypto\CryptoHelper;
use Org\Mxchange\CoreFramework\Request\Requestable;
use Org\Mxchange\CoreFramework\Response\Responseable;
}
// Now, both are set hash the given one. First get a crypto instance
- $cryptoInstance = ObjectFactory::createObjectByConfiguredName('crypto_class');
+ $cryptoInstance = CryptoHelper::getSelfInstance();
// Then hash the code
$hashedCode = $cryptoInstance->hashString($captchaCode, $captchaHash);
use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
+use Org\Mxchange\CoreFramework\Helper\Crypto\CryptoHelper;
use Org\Mxchange\CoreFramework\Helper\Template\HelpableTemplate;
/**
}
// Get crypto instance
- $cryptoInstance = ObjectFactory::createObjectByConfiguredName('crypto_class');
+ $cryptoInstance = CryptoHelper::getSelfInstance();
// Hash the CAPTCHA code for later comparison
$this->hashedString = $cryptoInstance->hashString($captchaString);