You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To speed up performance and lower memory consumption, Bottle should archive, compress and encrypt the contents of a file (tar or otherwise) in chunks when encrypting/decrypting.
Currently, when encrypting a directory, Bottle writes the entire directory's contents to tar file on the file system, then read that tar file back into memory in order to compress it.
Not great! I think attacking this part of the pipeline would be best.
Thankfully, the Builder of the tar crate we're using takes a Writer, so we should be able to make our own Writerimpl that directs the tar stream into compression.[1] I'm not sure how to do that yet, so any comments or PRs welcome!
If done right, this will also eliminate the need to write the (unencrypted) tar file to the file system, removing a potential security issue.
c1f0fcb at least makes it so Bottle doesn't write the tar file to the file system when encrypting a directory. It still reads the entire file into memory -- we still need to chunk it.
To speed up performance and lower memory consumption, Bottle should archive, compress and encrypt the contents of a file (tar or otherwise) in chunks when encrypting/decrypting.
Currently, when encrypting a directory, Bottle writes the entire directory's contents to tar file on the file system, then read that tar file back into memory in order to compress it.
https://github.com/sts10/bottle-rs/blob/main/src/lib.rs#L187-L200
Not great! I think attacking this part of the pipeline would be best.
Thankfully, the Builder of the tar crate we're using takes a Writer, so we should be able to make our own Writer
impl
that directs the tar stream into compression.[1] I'm not sure how to do that yet, so any comments or PRs welcome!If done right, this will also eliminate the need to write the (unencrypted) tar file to the file system, removing a potential security issue.
After that, we'll have to figure out how to "chunk" the compress-to-encryption pipeline.
(1) Relevant Rust book pages: 178 and in O'Reilly: 428?
The text was updated successfully, but these errors were encountered: