79456753

Date: 2025-02-21 08:44:34
Score: 1
Natty:
Report link

You can take a look at aesfile : https://github.com/bibi21000/AesFile

To encrypt :

import aesfile

with open(source, 'rb') as fin, aesfile.open(destination, mode='wb', aes_key=key) as fout:
    while True:
        data = fin.read(7777)
        if not data:
            break
        fout.write(data)

And decrypt :

import aesfile

with aesfile.open(source, mode='rb', aes_key=key) as fin, open(destination, 'wb') as fout :
    while True:
        data = fin.read(8888)
        if not data:
            break
        fout.write(data)

Or you can compress (with zstd) and encrypt in one pass, simply replace

import aesfile

with

import aesfile.zstd

Look at https://github.com/bibi21000/CofferFile/blob/main/BENCHMARK.md for performance impact.

Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: bibi 21000