upload_4.py 405 B

1234567891011
  1. def encrypt(filename):
  2. print('Encrypting: ' + log_dir + filename)
  3. with open(log_dir + filename, 'rb') as f:
  4. status = gpg.encrypt_file(f, None, passphrase=phrase, symmetric='AES256', output=log_dir + filename + '.aes')
  5. print('ok: ', status.ok)
  6. print('status: ', status.status)
  7. print('stderr: ', status.stderr)
  8. if status.ok:
  9. return True
  10. else:
  11. return False