functions encrypt and decrypt