[tomboy-list] New Addin for Tomboy
Adam D. Lopresto
adam at pubcrawler.org
Tue Aug 26 10:28:51 PDT 2008
On Tue, 26 Aug 2008, Justin wrote:
> Hi all,
> I've created a simple addin for Tomboy that encrypts/decrypts notes. I'm
> a little stuck on one feature, though, and I was wondering if you might
> help me.
> Right now, the addin encrypts the XML content of the note with a
> user-input password and puts a special text tag at the end, marking it as
> an encrypted note. This encrypted content replaces the note's plaintext.
> What the user sees is a bunch of garbage where the note text used to be,
> which is really the ciphertext. Of course, if the ciphertext changes in
> any way, the result is random garbage data, which is unrecoverable.
I think that's probably backwards. The cyphertext is not the plaintext, and
pretending it is is going to give you grief. I'd suggest changing the
plaintext to some message like "This note is encrypted. To decrypt it..."
with instructions (a button would be even nice). Then store the cyphertext
in a different tag. That way, the user can't accidentally break the note,
text searches won't be searching the cyphertext, etc.
It still might be desirable to make the note uneditable, or have it display
differently (grayed out, whatever), but I think the storage should be
> In other words, this means that any accidental edits made to the note
> post-encryption will trash the note forever.
> My initial (bad) solution was to set Note.Window.Editor.Editable false in
> the event that the "special" encryption tag was found. This "kind of"
> works, but I can still select text and delete it, and it's not obvious to
> the user why they can't make edits.
> Is there any way I'm missing that would make a note "uneditable" while
> it's in an encrypted state? I understand disabling edits doesn't really
> make sense in vanilla Tomboy, so if there's no easy way to do this, I get
> The only other option I can think of straight off is to prompt for the
> password when an encrypted note is opened, and close the note if the
> password is wrong and after initial encryption, but I'm not sure how this
> would be accomplished or even if it's the best solution.
> Also, as a small bonus question: I'm a bit of a GtkSharp noob...is there
> an easy way to prompt the user for a password? Right now I use a
> GtkEntry, but the text is plainly visible, which isn't good. I searched
> around, but maybe your Google-Fu is better than mine. :)
> Thanks for the help, and thanks for Tomboy! It's become a indispensable
> part of Gnome for me.
> PS: I hate Gtk.TextBuffers too. ;)
> Get thousands of games on your PC, your mobile phone, and the web with
> Windows®. Game with Windows
O what a heaven is love! O what a hell!
More information about the Tomboy-list