1
0
mirror of https://github.com/Tygs/0bin.git synced 2023-08-10 21:13:00 +03:00
0bin/README.rst

125 lines
4.9 KiB
ReStructuredText
Raw Normal View History

## Travis CI ember web client
[![Build Status](https://travis-ci.org/travis-ci/travis-web.svg?branch=master)](https://travis-ci.org/Python3pkg/0bin)
2012-04-24 13:34:08 +04:00
0bin
====
0bin is a client side encrypted pastebin that can run without a database.
2012-04-24 22:15:38 +04:00
* Try it: `0bin.net <http://0bin.net>`_
* `Report a bug <https://github.com/sametmax/0bin/issues>`_
0bin allows anybody to host a pastebin while welcoming any type of content to
be pasted in it. The idea is that one can (probably...) not be legally entitled
2014-10-19 11:34:44 +04:00
to `moderate the pastebin content`_ as they have no way to decrypt it.
It's an Python implementation of the
2012-05-22 14:49:12 +04:00
`zerobin project`_ under the `WTF licence`_. It's easy to
install even if you know nothing about Python.
2012-04-30 16:33:27 +04:00
For now tested with IE9, and the last opera, safari, chrome and FF.
2012-04-30 16:33:27 +04:00
2012-05-19 13:30:33 +04:00
There is a `good doc <http://readthedocs.org/docs/0bin/en/latest/>`_,
but in short::
pip install zerobin
zerobin
2015-05-10 20:53:55 +03:00
0bin runs on Python 2.7 and Python 3.4.
2012-05-19 13:30:33 +04:00
2012-04-30 16:33:27 +04:00
How it works
=============
When creating the paste:
2012-05-21 00:21:33 +04:00
- the browser generates a random key;
2012-04-30 16:33:27 +04:00
- the pasted content is encrypted with this key using AES256;
- the encrypted pasted content is sent to the server;
2012-05-21 00:21:33 +04:00
- the browser receives the paste URL and adds the key in the URL hash (#).
2012-04-30 16:33:27 +04:00
When reading the paste:
- the browser makes the GET request to the paste URL;
- because the key is in the hash, the key is not part of the request;
2012-05-21 00:21:33 +04:00
- browser gets the encrypted content end decrypts it using the key;
- the pasted decrypted content is displayed and sourcecode is highlighted.
2012-04-30 16:33:27 +04:00
Key points:
- because the key is in the hash, the key is never sent to the server;
2012-05-21 00:21:33 +04:00
- therefore it won't appear in the server logs;
- all operations, including code coloration, happen on the client-side;
- the server is no more than a fancy recipient for the encrypted data.
2012-04-30 16:33:27 +04:00
Other features
======================
- automatic code coloration (no need to specify);
- pastebin expiration: 1 day, 1 month or never;
- burn after reading: the paste is destroyed after the first reading;
- clone paste: you can't edit a paste, but you can duplicate any of them;
- code upload: if a file is too big, you can upload it instead of using copy/paste;
- copy paste to clipboard in a click;
- get paste short URL in a click;
- own previous pastes history;
2013-04-22 23:44:17 +04:00
- visual hash of a paste to easily tell it apart from others in a list;
- optional command-line tool to encrypt and paste data from shell or scripts.
2012-04-30 16:33:27 +04:00
Technologies used
==================
- Python_
- `The Bottle Python Web microframework`_
- SJCL_ (js crypto tools)
- jQuery_
- Bootstrap_, the Twitter HTML5/CSS3 framework
- VizHash.js_ to create visual hashes from pastes
- Cherrypy_ (server only)
2013-04-22 23:44:17 +04:00
- `node.js`_ (for optional command-line tool only)
2012-04-30 16:33:27 +04:00
Known issues
============
2012-05-16 11:15:14 +04:00
- 0bin uses several HTML5/CSS3 features that are not widely supported. In that case we handle the degradation as gracefully as we can.
2012-04-30 16:33:27 +04:00
- The "copy to clipboard" feature is buggy under linux. It's flash, so we won't fix it. Better wait for the HTML5 clipboard API to be implemented in major browsers.
2012-05-21 00:21:33 +04:00
- The pasted content size limit check is not accurate. It's just a safety net, so we think it's ok.
2012-04-30 16:33:27 +04:00
- Some url shorteners and other services storing URLs break the encryption key. We will sanitize the URL as much as we can, but there is a limit to what we can do.
2012-04-24 22:15:38 +04:00
What does 0bin not implement?
=================================
* Request throttling. It would be inefficient to do it at the app level, and web servers have robust implementations for it.
* Hash collision prevention: the ratio "probability it happens/consequence seriousness" `is not worth it`_
2012-05-21 00:21:33 +04:00
* Comments: it was initially planed. But comes with a lot of issues so we chose to focus on lower hanging fruits.
.. _moderate the pastebin content: http://www.zdnet.com/blog/security/pastebin-to-hunt-for-hacker-pastes-anonymous-cries-censorship/11336
.. _zerobin project: https://github.com/sebsauvage/ZeroBin/
.. _Python: https://en.wikipedia.org/wiki/Python_(programming_language)
.. _The Bottle Python Web microframework: http://bottlepy.org/
.. _SJCL: http://crypto.stanford.edu/sjcl/
.. _jQuery: http://jquery.com/
.. _Bootstrap: http://twitter.github.com/bootstrap/
.. _VizHash.js: https://github.com/sametmax/VizHash.js
.. _Cherrypy: http://www.cherrypy.org/
2013-04-22 23:44:17 +04:00
.. _node.js: http://nodejs.org/
2012-05-22 14:49:12 +04:00
.. _is not worth it: http://stackoverflow.com/questions/201705/how-many-random-elements-before-md5-produces-collisions
.. _WTF licence: http://en.wikipedia.org/wiki/WTFPL
Contributing
=============
Please fork the project, clone your repository and add the original repo as an upstream remote to keep yours in sync.
For small fixes (typo and such), you can work on master.
For features, you should create a dedicated branch.
In any case, if you modify Javascript or CSS files, you shall run compress.sh afterward to provide the minified files. It requires your to have yui-compressor installed (apt-get install yui-compressor on the debian family).
We don't require you to rebase/merge, ordinary merging is alright.
Once it's ready, just request a PR.