Drowning people are not going to save themselves on their own, so we suggest that you take four simple steps to increase the safety of your website visitors.

Having read the revelations of Snowden, we decided to work a little. I'll tell you about our experience of implementation, the consequences and the reaction of users.
Step 1. No registration
If the user does not have an account, then it will not be broken and stolen. The main functionality of the site should be available without registration. If for some reason registration is necessary for some users, we use OAuth to the maximum. Let Google with VKontakte have a headache from the same passwords, not you. It is done in a couple of hours
according to the instructions (
there are many ).
The consequences of this step: more "one-time" profiles.
Step 2. Only SSL, only hardcore
In the era of total logs, users may be wary of using your site just because they don’t want someone to know exactly which pages they viewed, what they searched for in your search engine, what articles they read, what messages they left on the forum. It is especially important if you have a lot of
different (like ours) content. The solution is simple - we
include https for everyone.Get a free certificate for example
here .
We take from the official site fresh nginx, we set, we govern configs.
Config example:
server { listen 80; listen 443 ssl; ssl_certificate _.pem; ssl_certificate_key _.key.decr; location /socket.io/ { proxy_pass :___signalmaster; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } location / {
')
We check everything works.
You will lose images from third-party resources, YouTube videos and others that you (or users) posted with the access protocol. It is treated simply enough - http http https in texts. If third-party resources "do not know how to ssl", then the pictures will disappear, so it is better to cache them to yourself in advance. Convenient hint - always use // links without specifying a protocol - by default, the browser will try to open them using the current protocol (https).
You will also need to update the code of statistics counters - Google Analytics, Liveinternet and Yandex.Metrica work fine on ssl. There are no problems with AdSense codes, they have not tried Yandex and other systems.
Unusual consequences with the indexation by search engines is not observed - and Google and Yandex are indexed as before.
Result: providers do not see what content your visitors (and not only providers) are watching. Advanced users are quietly happy, the rest do not notice anything.
Note: server load increases slightly, by a few percent, at the level of error.
Step 3. Cryptico
If you do not store user messages, they will never be stolen. If you can't read them, most intruders won't be able to.
To preserve confidentiality in communication between users, we implemented p2p encryption on clients (in the browser) and do not save the encrypted text (ideally, it should be started up directly).
In chat rooms we encrypt messages between users using RSA. For this we use for example the cryptico library (it lies on the
github.com/wwwtyro/cryptico github), the keys are updated during each communication session.
Chat runs on node.js and socket.io (examples of chats are on Habré). The signal server is hidden behind nginx (a fresh nginx can proxy web sockets), and nsnx implements ssl for the signal server.
A side effect is the lack of a message history.
It is impossible to find out what the users are talking about . Messages can only be sent online.
Step 4. Raise the mirror in i2p
Some of your users may want to hide the fact of visiting your site (for personal reasons). Do not complicate their task.
TOR and I2P users in Runet are about the same number (about 15-20 thousand daily living people), TOR-users cope on their own, so it makes sense to raise the mirror in I2P.
This is done fairly quickly, according to the instructions (http://habrahabr.ru/post/158559/ and
habrahabr.ru/post/97996/ )
Note: do not forget to delete all unnecessary javascript, statistics codes, calls to other people's services, pictures, etc., etc. from the code of the “mirror version”, so as not to compromise your visitors by chance. Of course, noscript should be installed for each I2P user, as well as access to external sites is blocked, but, as practice shows, the opposite situation occurs quite often.
Consequences: you do not understand who all these people are?
In general,
encryption is easy and pleasant!In general, we
urge you to make a runet a bit more private zone . Given the recent trends in the introduction of DPI, 12-hour storage of traffic, locks without a court-and-effect in the fight for copyright - it can be useful (I hope not).
You can try chat on the site
in profile .
PS Constructive paranoid suggestions, criticism and questions from "people in foil hats" are welcome.
PPS If you know more reliable analogues of cryptico - write in the comments.
upd. rebirth from oblivion, do not be surprised :)
upd2. Some information from deleted comments:
starius :
start the field " torchat " in the user's profile in order to stimulate not only encrypt the correspondence (the site already allows it) but also hide the fact of correspondence from everyone (including the site).
symbix :
if ($ ssl_protocol = "") {rewrite ^ https: // $ server_name $ request_uri? permanent; }
This is a bad way. That's right - something like this:
server {listen 80; location / {return 301 rospravosudie.com $ uri $ is_args $ args; }}
The hostname is intentionally recorded in an explicit form, so that those who came, say, at the ip-address, were not afraid of the red garbage. server_name is not always applicable (if it is guaranteed to fit in this configuration, it is possible).
Hello1 :
301 redirect is also not the right way. It must be combined with HSTS .
add_header Strict-Transport-Security max-age = 31536000;
Then modern browsers will themselves replace all http with https for internal links of the site.
ivlad :
RSA1024 by today's standards is not enough. Need to use RSA2048. In addition, you do not use modern versions of TLS - only 1.0 (and SSLv3). You should upgrade nginx and openssl.
Lockal :
How much can you repeat: stop inventing your own algorithms and redoing others, especially if you are good at cryptography! Here is such a pearl in Cryptico occurs several times:
if (navigator.appName == "Netscape" && navigator.appVersion <"5" && ​​window.crypto) {
Indeed, who needs a normal pool of RNG entropy, if navigator.appVersion <"5"? Let all users of the latest versions of Firefox, Chrome and IE remain to receive the entropy pool generated by the cycle from the millisecond timer.