dokucrypt is a client side (javascript) cryptography plugin. This plugins allows a user to store and access sensitive data in a dokuwiki. All sensitive data is encrypted before it is submitted and decrypted on the clients machine. A users' sensitive data will only be accessible when viewed with a javascript enabled browser and the proper pass phrase. It will never be transmitted or stored in plain text.
The Javascrypt (http://www.fourmilab.ch/javascrypt/) library is used for encryption and decryption to provide 256 Bit AES encryption.
In order to encrypt some sensitive data, the user needs to add text like the following
Hi world. I have a secret. Can you read it? < SECRET>I like ice cream< /SECRET>
When the user hits 'Save' (or a draft is attempted to be saved) a prompt will open, asking the user to enter a pass phrase key for the encryption. Once supplied, the encryption will be done in the browser and the encrypted text submitted to the server.
When the page is viewed, the user will see the encrypted text and a link 'Decrypt Encrypted Text' will appear which will prompt the user for a password and decrypt the text (see the example below).
The encrypted text is compatible with javascrypt decryption (http://www.fourmilab.ch/javascrypt/jscrypt.html).
To view the secret text in the example below, use 'secret' as the pass phrase.
Hi world. I have a secret. Can you read it? Decrypt Encrypted Text[Toggle Visible]
##### Encrypted: decrypt with http://www.fourmilab.ch/javascrypt/ ?b64Py5y9JZMVa728IXwqaBh+f9Tbz9jP9OvCY2UdexIz5i6bLRsCOF2IA9qECpp Bc6oY+BAihtLdzyrtQA3x6yrxg==?64b ##### End encrypted message
You can see a clipped screenshot here.
To edit the encrypted data, the user needs to Edit the wiki page. When first loaded, encrypted text will appear encrypted, surrounded by <ENCRYPTED> and </ENCRYPTED> tags. To edit this text, the user needs to press the 'DecryptSecret' button between 'Save' and 'Preview', and supply the correct pass phrase. The encrypted text will be decrypted to the 'SECRET' form showed above, and the use can edit in plaintext. Submits or drafts will be encrypted before submission with the same pass phrase supplied.
To install, simply extract the archive in the 'lib/plugins' directory under your dokuwiki installation and rename the 'crypt-X.Y' directory to 'crypt' (or replace an older version).
$ cd path/to/wiki/root/lib/plugins $ tar xvzf ~/dl/crypt-plugin-0.29.1.tar.gz $ mv crypt-0.29.1 crypt
In order to add this functionality, some hacks were needed.
In order for this hack to be avoided, two things would be needed, these would be difficult to do well in a no-javascript-available environment.