added methods for encrypt and decrypt message