]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/source/units/class_TestUnitSource.php
Cruncher continued and rewritten to use states:
[hub.git] / application / hub / main / source / units / class_TestUnitSource.php
index 5a6f1886dec5bf035c2622f96f9f0607a520ed7d..0de4ac22be0642109a69cc3ac7744304f9d6f07d 100644 (file)
@@ -41,7 +41,7 @@ class TestUnitSource extends BaseSource implements Sourceable {
                // 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);
 
@@ -63,7 +63,7 @@ class TestUnitSource extends BaseSource implements Sourceable {
                $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));