finished encrypt and decrypt functionality