For this all that is necessary is to change the constructor and the access method get_text for Message. The constructor will encode the message, and the access method will decode it. An even better (but more complex) solution would allow the user to set the key.