Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add support for encrypted text files
Motivation: As I keep some private files on my phone I needed some way to read / write encrypted text files on my phone. My original intention was to write a separate program, but seeing that it would have been necessary to implement all the file handling stuff myself I decided to just integrate it into file-manager instead.
Technology: For de- and encryption the "Gibberish AES" library is used (https://github.com/mdp/gibberish-aes), mainly because of it's size and speed. I did not do any security review! The library will decrypt files encrypted with AES-256-CBC, thus making it compatible with OpenSSL (and several other libraries). A password of sufficient length (>=12 characters) should keep a supercomputer busy for several decades 😏
Testing: I'm personally using this feature for several months now, but cleaned it up a bit today for this pull request.
Merging: The big question is if such a feature would be interesting for master, so feel free to reject it if you don't think it suits 😏. In case a merge seems reasonable I'll also change the documentation and translation parts of the source in later commits.
Usage: The text editor now has a new lock icon, indicating if the file will be saved with (locked) or without (unlocked) encryption. You can turn encryption on and off by pressing that icon. If you turn encryption on you will be asked to enter a password, which will be applied when saving the document. If you turn it off the document will (obviously) be saved without encryption.
If you open a document which is encrypted already you will be asked for your password on opening. And if you just want to see the encrypted file you may leave the password field empty.