implement decryption, encryption, making a copy and removing tmp file