Addendum:
When using TiddlyTools decrypt[...]
filter, if the “password” you provide is incorrect the filter returns the text:
CORRUPT: ccm: tag doesn't match
(this is the value returned from the underlying Javascript sjcl.decrypt()
library function)
So, when fetching the saved key from the encrypted JSON, if that text is returned, you will want to set the $:/temp/APIKey!!key
value to blank, like this:
<$button> get key
<$action-setfield $tiddler="$:/temp/APIKey"
key={{{ [{MyAPIKey}decrypt{$:/temp/APIKey!!password}!match[CORRUPT: ccm: tag doesn't match]] }}}/>
</$button>
-e