- Notifications
You must be signed in to change notification settings - Fork1
Decrypts encrypted files on the fly using WebCrypto in a Service Worker
License
wiktor-k/sw-crypto
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Decrypts AES-GCM encrypted files using keys embedded in URL fragments.
This kind of URLs is generated byConversations when uploading filesin encrypted chat sessions.
Putting this Service Worker on HTTP Upload host allows users to open encryptedfiles in their browsers without transmitting encryption keys.
Start a server:
python -m SimpleHTTPServer
Go to root page:
http://localhost:8000
This will register Service Worker and allow decrypting files, such as this one:
http://localhost:8000/leaf-veins.jpg#492fc2ba53dd27a4f4a6a250310609f0c6c82267073eb9967390796a2d770e0a89d3f95c650d1f533e60b7e51a96cacf
Service worker is installed only on explicit call from JavaScript or when a Link header is inserted in response headers:
Link: </worker.js>; rel="serviceworker"; scope="/"
To check this version use:
python server.py
Unfortunately the initial request will not be processed by the Worker so the first file will not be decrypted.
SeeA header-based SW installation for more details.