Skip to main content

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 CLI clients 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:

  1. A random key is generated at the client.
  2. The client encrypts the data with this key.
  3. The client sends the encrypted data to the server.
  4. The server stores the encrypted data.
  5. The server returns a safe URL pointing to the encrypted data.
  6. 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:

  1. The server responds with the encrypted data.
  2. 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

screen recording

Usage

Server

$ pipenv install
$ pipenv run python -m seenoevil

For a complete list of the environment variables, please check settings.py.

Web client

Open 127.0.0.1:8000.

CLI client

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 formatter is recommended (i.e. jq).

Dependencies

Client

  • sjcl
    • Included in the codebase.
    • Used for client side encryption.

Python

  • sanic: Async web server (check server.py::app)
  • sanic-jinja2: Jinja2 support for sanic (check templates/)
  • peewee: ORM (check models.py::Secret)
  • itsdangerous: URL safe serializers (check models.py::TokenField)
  • environs: Environment variables (check settings.py::env)

Heroku

Deploy

For a complete list of the environment variables, please check settings.py.

Design

Model

  • Secret
    • id: UUID4, primary key
    • data: Encrypted data sent by the client.
    • expiration: Date the Secret will be removed.
    • reads: Maximum number of reads before the Secret self-destructs.

Create action

Create action – Sequence diagram

Show action

Create action – Sequence diagram

Folder structure

seenoevil/      # Server
  __init__.py
  server.py
  model.py
  settings.py
  __main__.py
js/
  cli.js        # CLI client
  web.js        # Web client
  lib.js        # Encrypt and decrypt functions, shared by the Web and CLI client
  vendor/
    sjcl.js
secrets.db      # Default SQLite3 database
.env            # A default SECRET_KEY is generated by the server here if it's not set

For details about the folder structure please use purpose.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

seenoevil-0.1.2.tar.gz (29.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

seenoevil-0.1.2-py2.py3-none-any.whl (36.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file seenoevil-0.1.2.tar.gz.

File metadata

  • Download URL: seenoevil-0.1.2.tar.gz
  • Upload date:
  • Size: 29.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5

File hashes

Hashes for seenoevil-0.1.2.tar.gz
Algorithm Hash digest
SHA256 8b1880ff27fb7b05dd23349080702b593ec58a9a63eb3b1d402844ec44052d02
MD5 52238daac53fa492bb55f555843c1c13
BLAKE2b-256 4bae01c318d412ecde677236b224e01985dc29103b9d7bccff3fc0c1100cc7ba

See more details on using hashes here.

File details

Details for the file seenoevil-0.1.2-py2.py3-none-any.whl.

File metadata

  • Download URL: seenoevil-0.1.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 36.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5

File hashes

Hashes for seenoevil-0.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 cbd03406b9875beda61bf21d68cb8084ecf709d2de7cedf03611947a1a1ae126
MD5 9480b41458da08d1c47ebf72da145110
BLAKE2b-256 5a0cb8ba138fafb08b38e98371c650b5e306c14f4ff3e8ee4a94380c5465beaa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page