// Get crypto instance
$cryptoInstance = ObjectFactory::createObjectByConfiguredName('crypto_class');
+ // Hash the CAPTCHA code for later comparison
+ $this->hashedString = $cryptoInstance->hashString($captchaString);
+
// Encrypt the string for later usage
$this->encryptedString = $cryptoInstance->encryptString($captchaString);
-
- // Hash the encrypted string for later comparison
- $this->hashedString = $cryptoInstance->hashString($this->encryptedString);
}
/**
// Load a template for this CAPTCHA
$this->getTemplateInstance()->loadCodeTemplate("captch_graphic_code");
- // Assign variable
+ // Assign variables
$this->getTemplateInstance()->assignVariable('encrypted_code', urlencode(base64_encode($this->encryptedString)));
+ $this->getTemplateInstance()->assignVariable('captcha_hash', $this->hashedString);
// Compile the template
$this->getTemplateInstance()->compileTemplate();