writing an encrypt_file method