To tar and encrypt a folder in OpenSSL in Python, follow the below steps using the subprocess
module:
main.py28 chars3 lines
main.py323 chars7 lines
main.py84 chars2 lines
encrypted_filename
in write binary mode, and encrypt the tar_filename
file.main.py191 chars3 lines
main.py42 chars2 lines
Putting it all together in a function:
main.py819 chars18 lines
Note: Remember to pass the passphrase
as a bytes
object.
gistlibby LogSnag