+
+ /**
+ * Generates an encrypted random message
+ *
+ * @return $encryptedMessage The encrypted random message
+ */
+ public function generateRandomMessage () {
+ // Get a very secret message by encoding and random string with BASE64
+ $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'));
+
+ // Now encrypt the message with our key and a good (strong) cipher
+ $encryptedMessage = base64_encode($this->getCryptoInstance()->encryptString($secretMessage, $secretKey));
+
+ // Return it
+ return $encryptedMessage;
+ }