// Get new instance
$sourceInstance = new TestUnitSource();
- // Create a RNG instance and set it in this source
+ // Create a RNG instance and set it in this class
$rngInstance = ObjectFactory::createObjectByConfiguredName('rng_class');
$sourceInstance->setRngInstance($rngInstance);
$secretMessage = base64_encode($this->getRngInstance()->randomString($this->getConfigInstance()->getConfigEntry('random_secret_message_length')));
// Get a random, secret key
- $secretKey = $this->getRngInstance()->randomString($this->getConfigInstance()->getConfigEntry('random_secret_key_length'));
+ $secretKey = $this->getRngInstance()->randomString($this->getConfigInstance()->getConfigEntry('test_unit_random_secret_key_length') / 8);
// Now encrypt the message with our key and a good (strong) cipher
$encryptedMessage = base64_encode($this->getCryptoInstance()->encryptString($secretMessage, $secretKey));