samuel-lucas6 / Kryptor

A simple, modern, and secure encryption and signing tool that aims to be a better version of age and Minisign.
https://www.kryptor.co.uk
GNU General Public License v3.0
431 stars 33 forks source link

šŸ“‹ Feature: Speed up reading original file name for large files #8

Closed samuel-lucas6 closed 3 years ago

samuel-lucas6 commented 3 years ago

Is your feature request related to a problem? Please describe. I've been benchmarking file encryption for large files (2 GB) after making some file handling changes for the next release and noticed that most of the decryption time is due to File.ReadLines() being used to read the last line of the file to retrieve the original file name when the Anonymous Rename setting is enabled.

Describe the feature you'd like In the next major release, I need to either find a faster method of reading this information, move the location of the original file name so that it's easier to access, or switch to a different method of storing the file name (e.g. how Cryptomator does it).

Cryptomator's method would probably be fastest as it requires no reading from the file at all, but I'd have to encrypt the file names and convert them to a safe format for the file system. The main limitations of this approach are that the user can't rename the files without losing the original file name and that handling long file names is problematic.

Why should this feature be implemented? To speed up decryption of large and medium sized files.

samuel-lucas6 commented 3 years ago

Fixed in v3.0.0 Beta.