- $encryptedMessage = $this->getSourceInstance()->generateMessageFromSource();
- die($encryptedMessage."\n");
+ $encryptedMessage = $this->getHelperInstance()->generateRandomMessage();
+
+ // Debug message
+ self::createDebugInstance(__CLASS__)->debugOutput('PRODUCER: An encrypted, random message has been generated. Generating keys ...');
+
+ // Set the encrypted message in the template instance
+ $this->getTemplateInstance()->assignVariable('encrypted_message', $encryptedMessage);
+
+ // The state must be changed because we have a new message
+ $stateInstance->encryptedMessageGenerated();