Writes to encryption and decryption to file.