summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2016-10-09 01:54:34 +0200
committerDirk Engling <erdgeist@erdgeist.org>2016-10-09 01:54:34 +0200
commitc932cd295d414f78c65167e7717b04f61e93122a (patch)
treeaad57f7461ad72ba4ebf4e411f112e1eacb26ad0 /README.md
Initial tests
Diffstat (limited to 'README.md')
-rw-r--r--README.md27
1 files changed, 27 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..a2eb441
--- /dev/null
+++ b/README.md
@@ -0,0 +1,27 @@
1# Simple AES-256-CCM-PSK drop in front end script for the sjcl library
2
3This script is intended to be just included in any HTML document via a simple <script src="sjcl-front.js"></script>
4and provide ad-hoc group crypto for that site.
5
6The script walks through all text nodes and checks for the sjcl-front signature sjcl://
7and tries to retrieve a key from localStorage or sessionStorage whose name matches the
8one encoded as associated data in the encoded sjcl dictionary. If it can decrypt the
9string, the text node's content is replaced by the plaintext and a class sjcl-decrypted
10is added to its parent node.
11
12If the respective key can not be found, the class sjcl-undecrypted is added to the
13parent node, which also receives a copy of the ciphertext, before the text node is
14replaced by an informative message. A click handler for sjcl-undecrypted objects allows
15to later re-decrypt the text by providing a key.
16
17During initialisation, the script also walks through all TEXTAREA nodes and injects a
18hook revealing a contextual drop down menu that allows encrypting the TEXTAREA's content,
19decrypting it and adding/deleting keys in localStorage. Future versions may allow adding
20that hook to text input fields or filtering by class or id.
21
22Finally the script injects CSS to the document's head to get the injected nodes working.
23
24You can try the script at [https://erdgeist.org/webcrypto/].
25
26The library that does the heavy lifting can be found here: https://github.com/bitwiseshiftleft/sjcl
27