Updated code so that it encrypts the messange.