Idea for a different concept for encrypting tiddlers

I think it is really usefull to be able to encrypt tiddlers like with DanielO’s EncryptTiddler
My problem is, that it is easy to forget about encrypting, when leaving the wiki.
I would like to have a variant of the plugin where the encrypted content is not decrypted into the tiddler itself but into a temporary tiddler let us say $:/temp/decrypted/tiddlername which by default is not saved, this could be shown as tiddlerbody using a viewtemplate.

Who can code a thing like this?

1 Like

If every tiddler is stand alone, it may be doable. But – When you save a decrypted wiki it will be encrypted on save as long as the password is active.

So I do not really understand where your problem is. You can only forget to clear the password not the other way around.

Hello @pmario I rather meant the encryption of single tiddlers. I added the link to DanielO’s Plugin above.
My current usecase is that I would like to hide my AI API-Key for the @well-noted 's WikiSage-Plugin. It would not be good to forget to rencrypt this and even worse: Saving while I am working on my wiki AFAIK saves it with a temporarily unencrpted tiddler as I understand.

I think this should be possible with the plugin right away, without much additional effort.

When you encrypt a tiddler with this plugin, all its fields (incl. title and tags) are encrypted and stored in the encrypted field. The title and tags fields are left as they were in plain text, other fields are removed.
When you decrypt the tiddler, it is as if you force-imported a tiddler from the data stored in the encrypted field.
This can lead to unexpected results and confusion if the encrypted tiddler was renamed (e.g. indirectly be Relink), but could actually be useful in your case.

Try the following:

  • make sure that any temporary tiddlers prefixed $:/temp/ will never be saved or made public in your setup, this is crucial
  • create a tiddler $:/temp/secret with the secret in its text field
  • encrypt it using the plugin
  • rename the encrypted tiddler to something that will get saved, i.e. not temporary, maybe not system to be able to find it easy, e.g. Secret
  • you can now save the wiki, the encrypted secret is stored in the tiddler Secret
  • when you decrypt Secret with the plugin, it will “import” the tiddler $:/temp/secret with its contents decrypted, but the encrypted Secret should remain untouched
  • any other tiddlers requiring the secret can now access it from $:/temp/secret
  • you can safely save the wiki, since the unencrypted temporary tiddler should not get saved

We use <$password name="github"/>, which stores the API key in the browser local-storage. So it will not be needed to be encrypted. Would this be an option?

See: https://tiddlywiki.com/#PasswordWidget

2 Likes

This is What I would expect a Marco to do automatically - plus appending the TempTiddler to the body of the encrypted one by viewtemplate