Client side encrypted pastebin.
Project description
🙈 See No Evil
Client side encrypted pastebin.
- It has been designed to be short and simple to read.
- Data is encrypted at the client. It only has one JS dependency.
- Web and Command Line interfaces are provided. They both share the same JS library for encrypting and decrypting.
How it works
The fragment identifier of the URL (#
) is never sent to the server:
Interpretation of the fragment identifier is performed solely by the agent that dereferences a URI; the fragment identifier is not passed to other systems during the process of retrieval. This means that some intermediaries in Web architecture (such as proxies) have no interaction with fragment identifiers and that redirection (in HTTP [RFC2616], for example) does not account for fragments.
Each time a user sends data to See No Evil:
- A random key is generated at the client.
- The client encrypts the data with this key.
- The client sends the encrypted data to the server.
- The server stores the encrypted data.
- The server returns a safe URL pointing to the encrypted data.
- The client appends the random key it generated to the received URL as a fragment identifier and shows it to the user.
Then the user can share this URL with someone else:
- The server responds with the encrypted data.
- The client extracts the key from the URL fragment identifier, decrypts the data, and shows it to the user.
Features
- Every secret has an expiration date. A temporal task deletes the expired ones every ten minutes.
- Every secret has a maximum number of reads. After all the reads are consumed, the secret is deleted.
- The server has a REST API. A command line interface is provided.
Demo
https://seenoevil.herokuapp.com
Usage
Server
$ pipenv install
$ pipenv run python -m seenoevil
Open 127.0.0.1:8000.
For a complete list of the environment variables, please check settings.py
.
CLI
Requires Node.js v8.15.1
.
$ bin/seenoevil
usage: seenoevil create DATA [EXPIRATION[ READS]]
seenoevil show URL
Set the HOST
environment variable to set a different server:
$ HOST=https://seenoevil.herokuapp.com bin/seenoevil create "I like pancakes"
{"path":"/secret/IjAwNTk5YTM0ZjNjNDQ2MTNhNjg0NTQxMGY0Mzk1Njk2Ig.xDziE424HiU5Qb0u8FgdaSda2Ug#Ji3WsojAmAJ7hwb5fggY3KI92PLFOtmC_v9UYwNM3QY"}%
The CLI prints JSON to the STDOUT. Using a JSON parser is recommended (i.e. jq
).
Dependencies
Client
sjcl
- Included in the codebase.
- Used for client side encryption.
Python
sanic
: Async web server (checkserver.py::app
)sanic-jinja2
: Jinja2 support forsanic
(checktemplates/
)peewee
: ORM (checkmodels.py::Secret
)itsdangerous
: URL safe serializers (checkmodels.py::TokenField
)environs
: Environment variables (checksettings.py::env
)
Design
Model
Secret
id
: UUID4, primary keydata
: Encrypted data sent by the client.expiration
: Date theSecret
will be removed.reads
: Maximum number of reads before theSecret
self-destructs.
Create action
Show action
Folder structure
bin/
seenoevil
seenoevil/
__init__.py
server.py
model.py
settings.py
__main__.py
static/
app.js
lib.js
sjcl.js
styles.css
For details about the folder structure please use purpose
.
Heroku
For a complete list of the environment variables, please check settings.py
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for seenoevil-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 076ba3adb835753818c6a71d7b0fd391f5a7abbd7368fe350bc32c20e5f3228f |
|
MD5 | 38b8566997d23ccf20cfe0377765352e |
|
BLAKE2b-256 | 98a754d1b35b65fc8e90089c4e3dadf66797a1aa18db6ddccaf4dba59b47fbc1 |