#Private journal blocks

70 messages · Page 1 of 1 (latest)

warm gale
#

I would like to have some journal entries in logseq that are private unless unlocked with a password. There is a "lock block" plugin but it isn't good for writing because it can only unlock your text to the clipboard. Rather, I would like blocks to have a button that allows them to be encrypted/decrypted. The idea is that they wouldn't even show up in search - though one could nest them under parent blocks with search terms and tags to be able to find them.

Right now I use a separate app to write my truly private journal notes, but it would be much more natural to have those right in logseq. But I don't want them visible to others. For instance, imagine I'm writing a private journal about how I hate my boss, and but I also have a project tagged with my bosses name. I don't want the text about how I hate my boss to show up when searching for the project. There are other ways to do this, but a simple encryption/decryption block would be the easiest.

Ideally it would be easy to quickly encrypt/hide if someone is walking by - using a button or a hotkey.

Also would be good if the decryption tool was open source so I could run it on the encrypted blocks without logseq if necessary (for future-proofing).

Not necessary, but potentially useful would perhaps even a way to decrypt all encrypted blocks at once - in case I did need to search for something?

I'll start the pot for this bounty off with $30, but my hope is that other people will add to the pot if they would also like to see this developed. If someone is interested but feels the bounty is still too small, let me know.

warm gale
#

Actually, it would need to be a bit more complex than what I wrote above. It shouldn't just be one block that is encrypted, but all child blocks of the root (unencrypted block). For instance:

#journal [[notes on meeting at work]]

  • paragraph 1
  • paragraph 2
    • sub block

In that case, all the blocks with a "-" in my example should be encrypted.

safe robin
#

I would back this. Having classified levels when publishing online would be great as well

umbral tiger
#

Creating a button or shortcut to encrypt/decrypt all children blocks of a block would not be hard. And just a Caesar cipher would sufficient. There is also no shortage of other possible schemes, easily implemented in JavaScript.

The most challenging part imo is the function to mass decrypt blocks on many different pages. Page only re-render when accessed so I don't think a plugin could modify value of a non-opened page.
On the other hand, a shell script to search the markdowns and find encrypted blocks then decrypt all of them would be quite trivial.

#

this is very similar to the redacting plugin for privacy request below. So here could be a possible workflow.

#

Or instead of adding template blocks. The button could be used to encrypt all the children blocks or trigger a function to auto-encrypt children blocks on rendering.
Then a global setting could change the button function to decrypt the children block.

#

With that saying, I am happy to implement it if you are satisfied with the workflow.

warm gale
umbral tiger
#

decrypting all encrypted blocks at once is possible after all.

#

going to add some more customization and will push to marketplace

umbral tiger
#

This is the semi-finish version. The encrypting is very rudimentary though I think it would be sufficient for your use-case.

#

I will add an option to encrypt with passwords soon in the future.

warm gale
# umbral tiger https://github.com/duydl/logseq-privacy-mode

Looking good so far. I installed the beta version. A few quick notes:

  1. Right now it seems I need to go into the settings to change the button behavior before it will decrypt. I assume that eventually one will be able to toggle hide/show by clicking on the button without going into the settings? (With a password prompt to decrypt.)

  2. I saw there is another feature to hide blocks instead of (or in addition to?) encrypting them? It didn't seem to do anything in my tests.

  3. I saw a toolbar button for "privacy mode encdec." This didn't seem to do anything either? Is this planned for bulk encoding/decoding?

I don't really need the hidden block feature, but I suppose other users might. Password support, however, is very important. I imagine having a single password, defined in the settings rather than a different password for each encrypted block.

Will it be possible to decrypt blocks outside logseq if (for some reason) I could no longer use Logseq or the plugin? Will this work with the password as well?

I really appreciate how fast you have managed to pull this together!

#

I should say that I'm using version 1.0.2, since it seems you are updating rapidly.

umbral tiger
#
  1. my bad. true. it would be better to change the state of button after clicking instead of associating it with the global setting
#

here how to use the hide blocks function

#
  1. you could do globally encrypt/decrypt with the privacy mode encdec
#

regarding the password. It is actually very trivial to add it. I actually took it out temporarily to figure out a way to have the user decrypt all blocks before changing password, else it could get quite messy.

umbral tiger
#

I add option to encrypt with password in the new update.

warm gale
#

Cool. I'll check the new version when I get a chance.

warm gale
#

Here are notes on version 1.1.2

A. Block buttons now properly toggle hidden or encrypted state. However, when decrypting it does not ask for the password.

B. The toolbar buttons work for encrypting, decrypting, as well as for hiding/showing but only per the settings. They do not toggle.

C. I had a weird situation that only happened once. I was not able to reproduce it. In this scenario I had two nested blocks under the block with the encrypt button. When I encrypted the first block was properly encrypted, but the second block was erased.

D. The password field in the settings should be able to hide the password.

umbral tiger
#

B. Toolbar will not toggle. you have to change the setting manually. i.e feature not bug

#

A. I will add later.
C. Tell me when y meet this bug again. I suggest do more testing before using the password feature.
D. Note that. Not very high priority. I could hide the password field from the setting and let advanced user define password in the json file. etc

warm gale
#

Another note. Right now when I use the slash command to create an encrypted button it deletes whatever I have typed. For instance, if I type #Journal and then enter the slash command, I wonder if it could handle this?

umbral tiger
#

sr for that bug. I could fix that now

#

Would a password prompt when decrypt without having the text encrypt with a password be sufficient?

umbral tiger
#

I add that prompt. checkout the newest update.

#

gonna be a while till i could return to this. have fun

warm gale
warm gale
warm gale
umbral tiger
#

I already made a PR. still wait for approve

warm gale
# umbral tiger https://www.decode-tools.com/base64decode/

So the password doesn't seem to actually affect the encoding. If I copy paste into the online decoder it decodes fine without the password. While this is good enough for now, I wonder if a more robust solution might be possible in the future. Something where the text is truly encrypted without the password?

umbral tiger
#

well without password it is not truly encrypted. Though there are thousand of ways to modify the text. I may add some other method, or return the encryption password option.

#

just remember to decrypt everything when changing the password and preferably when update the plugin. though i will not introduce any breaking change.

warm gale
#

I'm finding behavior a bit inconsistant as well:

sometimes it doesn't encrypt, but says it does

umbral tiger
#

you probably have to exit from the editing block for the data to be recorded

warm gale
#

And sometimes it doesn't decrypt, but says it does

warm gale
umbral tiger
#

yes because the data is not yet recorded into the program the plugin only see an empty string

#

else, i have no idea.

#

i will not have time to test further till weekend

warm gale
# umbral tiger well without password it is not truly encrypted. Though there are thousand of wa...

Just to followup on this for clarity.

It seems like you are thinking on the same lines, because I see in the settings you have an option now for a "passphrase" as well as a "password." But it says it currently doesn't do anything.

So if I understand your thinking here. You see the password as simply a lock on the plugins' ability to run the decrypt function, but a passphrase (when implemented) would actually modify the encoding so that one can't decrypt without a passphrase.

warm gale
#

Also, I sent you a DM asking how to send you the bounty...

#

I don't know if @safe robin still wants to support this as well?

umbral tiger
#

just buy me a coffee or two if you like it.

#

would appreciate some feedback/help on the README also. I would not use the encrypt/decrypt feature much.

warm gale
safe robin
#

is the short answer

umbral tiger
# warm gale Hmmm. Maybe that is the issue.

this is because of a bug within logseq api to get out of editing mode. I added a fix to not updating the block being selected instead of trying to get out of editing mode. You should no longer encounter that issue again in the latest version.

#

You should still get out of editing mode before encrypting though, else y have to decrypt and encrypt again for that block not updated.

warm gale
#

Maybe I didn't see it before but there is now a "buy me coffee" link to support @umbral tiger in the plugin box when looking in the plugin window in Logseq. I have paid the bounty that way. Thanks.

I would still very much like to see if the plugin could be made so that encrypted blocks are truly private. That is, are encrypted with a passkey that only I know and can't be decrypted without it (by anyone). It looks like it is already planned as there is a non-functional box for it in the settings.

umbral tiger
#

the secret passphrase was available from the beginning.

#

And I added password requirement for open setting page / make it semi-unaccesciable from the plugin setting list.

warm gale
safe robin
#

This will be invaluable to me. But first I need to make time to actually learn how to publish. Right now I am still noob, and I do not even know the difference between the publish:: and public:: properties. Is there a 'private::' property? Or would that be redundent?

safe robin
#

Propper start. Initially considering the projects name is logical and natural. Deep in thought, distracted by thoughts that branch off from a name for the projects, is a vulnerable transience, and most alluring way of being, that would allow AD(H)D to .... this is getting too long.

Indicated (sterk aanbeveel): [[OCD repellent]]. Intrusive obsesssive thoughts about naming schemas are disappating and my mind becomes clear. Clear enough to see how stupid even my stupidity is. Clearly. NEXT:

  1. Deploy an AI agent and task it to read this thread and bring me up to speed about what idees people have come up with. To be
    /me yawns con
#

...tinued after REM sleep

#

why does my spelling always deteriorate when i am tired? How can fituge have over such implicit memory that i hardly think about when awake. I see the the red line below fituge. I know it is spelled fatigue, and I am painfully aware of how clumsy the structure of that sentence is. Sympathetic nervous system, my friend, you really are very, very fix:adjectiveneeded here. Dispica

#

lil sis at friends house. too hot for cushion cuddling. Should I read a book or watch a movie? Ive read enough today. A movie it is. Eeenie meanie hermoine motion film. Nah... im 4 years to old for JRTolkien. Ive got it. Spirited Aw.... no. Arrie..... Studio Ghibli: Kiki's delivery service.

#

Im a bot but she is probably one as well. Which do not exist, so she must be. That doesnt keep my filthy base reflexes to widen when she flies her broom, and the wind suddenly[family server]. James Joyce would hate how i cen**r my stream of consciousness. Luckely no one would ever read this far, unless they are insane or a mod who takes their volunteer work way to serious. I wonder, do mods volunteer for fun, or do they get paid handsomely. Maybe they are like Dexter Morgan, and do this to satisfy their dark passenger.