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