RAASNet icon indicating copy to clipboard operation
RAASNet copied to clipboard

RSA

Open aliagm opened this issue 3 years ago • 0 comments

Hello How can we encrypt files larger than 50 GB using this code?

def encrypt(message, key, key_size=256): message = pad(message) iv = Random.new().read(AES.block_size) cipher = AES.new(key, AES.MODE_CBC, iv) return iv + cipher.encrypt(message)

def encrypt_file(file_name, key): with open(file_name, 'rb') as fo: plaintext = fo.read() enc = encrypt(plaintext, key)

with open(file_name, 'wb') as fo:
    fo.write(enc)
os.rename(file_name, file_name + '.DEMON')

aliagm avatar Mar 07 '22 18:03 aliagm