Python Pycryptodome AES-GCM encryption code performance improvement
问题 I am having around 19G of data which I am doing tar and then encrypt. I use below code to do the job. from subprocess import call from Crypto.Cipher import AES from Crypto.Random import get_random_bytes import sys cmd = ["tar","--acls","--selinux","-czPf","./out.tar.gz","./src"] proc = call(cmd) data = open("./out.tar.gz", "rb").read() key = get_random_bytes(32) cipher = AES.new(key, AES.MODE_GCM) ciphertext, tag = cipher.encrypt_and_digest(data) out = open("./out.bin", "wb") [out.write(x)