2

Is there a lightweight notepad program that:

  • saves files encrypted with a password
  • asks for the password on Open
  • doesn't ask for the password on Save (since it's already open, no need to re-enter the password) except if it's a new file
  • never saves unencrypted content to disk (this is very important: even if deleted, a file saved on disk can sometimes be undeleted)
  • is open-source (security without open-source is rather pointless)

Unforuntately Sublime Text and Notepad++ doesn't seem to support this with a good UI/UX (there are plugins, but the UX is not very good: you manually have to do "Decrypt" after the file is opened and first displayed as crypted content, then you have to Encrypt before each save, etc.)

Note: this question is close to Notepad with Encryption but has more precise UX requirements (such as open-source, etc.)

1

As I didn't find exactly what I wanted, I finally spent a few hours building this:

sdfgh, an encrypted notepad

It's a single Python file of < 100 lines of code, so you can easily read the code, and decide if you trust it or not! (very important to be able to read the source easily for security-sensitive encryption programs).

0

I suggest to port Sublime Text plugin to CudaText. It also has Python API but it allows plugin to handle on_open_pre and on_save_pre events, so plugin can avoid showing of encrypted content, and avoid asking of password on save. Most code of Sublime plugin can be re-used I think.

  • Thank you for your answer. It seems like an interesting open source text editor! on_open_pre is really interesting indeed, and not present on Sublime IIRC. on_save_pre is already there on Sublime, but if we encrypt automatically on Save, then after the saving, the text will be crypted in the view. Then 2 solutions: 1) let like this (then impossible to continue editing after a save!), or 2) restore unencrypted text in the view ; then the editor will see the file as "modified" which is not true! – Basj Dec 2 '19 at 12:29
  • Wiki wiki.freepascal.org/CudaText_API#General shows that there is also on_save (called after save), it may help. – RProgram Dec 2 '19 at 16:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.