5

Boris Reitman on Privacy

 3 years ago
source link: https://borisreitman.com/privacy.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Confidential Communication

End-to-end encryption using built-in web browser cryptography.

I am an advocate of private communication and I've made this tool to encourage it. The tool uses built-in browser functionality to perform a Diffie-Hellman exchange. Use it to establish a 44-character password that you can use to encrypt further communication.

No private data are sent to the server. However, do not take my word for it. You may either copy this page and host it on a web server that you trust, or use it as a local file. See developer notes section for more info.

Do not close this page, unless...

The page is reset on every refresh and nothing is saved. Keep this page open until you are finished. For example, if your goal is to establish a new password with another party, then do not close this page until you get it.

Use the "Save Backup" feature to store page's state in a file. If you have saved a backup file you can close this page, but remember to restore its state from backup when you reopen it.

Video Tutorial

Shared Password

By exchanging special non-confidential codes you can agree with another person on a confidential password. This form allows you to do it.

Load Backup

This page resets every time you visit it, resulting in a new password exchange. If you have previously created a backup file, load it now to restore the state of the page.

Exchanging Codes

Follow these steps to agree on a shared password with another party:

1. Both of you should open this page. 2. Paste the exchange code that you have received from him: 3. Send your exchange code to him:

Shared Password

Full:

Short:

Check:

For encryption purposes use the full password. If you only need a login password, use the shortened password.

Both you and the other party should see the same shared password. Verify this using the check digits shown.

Comparing check digits is critical for your own privacy because it allows you to double check that you are communicating with the right person. It is best to call the other party on his phone and compare them by voice. The check digits can be because they are not confidential.

Save Backup

This page resets every time you visit it. It does not save anything in the browser, so if you wish to backup random values shown on this page, use the button bellow to save its state.

Confidential Files

If you need to encrypt only a short message then use the encryption tool below. Otherwise package any number of documents in a password protected archive. Use the full shared password to encrypt the archive.

Use only archiving formats that offer strong encryption. For a Mac-to-Mac transfer use a DMG virtual disk image. For a Windows-to-Windows transfer use a VHD virtual disk image. This way, the recipient of your archive would not need to install additional software to open it. Otherwise, use the 7-zip archiver and ask the recipient to install it.

You can also buy an external hard drive and format it as an encrypted file system. Use the derived shared password for the encryption. Then, store on the drive anything you wish and mail it by regular mail. This way you can transfer terrabytes of data securely.

Confidential Messages

Encryption Key:

The encryption key is automatically set to the shared password derived above. However, you can change it to any other value. The longer it is and the more cryptic it is, the better it is.

Note Whatever you fill here would not be saved in a backup file. Whenever you load a backup file, the value will be set to the shared password stored in the backup.

Encrypt Message

Message: Encrypted:

Decrypt Message

Encrypted message: Decrypted:

Clone this page

As mentioned in the Overview section, you do not have to trust that I am not storing your passwords. You can copy this entire web page and run it directly from your computer.

If you are using Google Chrome, copy this entire page using "File Save Page As" menu option. In the Save dialog that appears select "Webpage, Complete." Then, click the downloaded HTML file to open the downloaded page. It should work just as the original.

When you save the page as "Webpage, Complete," the browser creates a support folder of the same name as the HTML file. This folder contains additional files that the HTML file needs. If you are going to move the HTML file elsewhere on your disk, be sure to remember to move the supporting folder to the same location as well.

If you run this page from your local drive, you will not see any changes that I make to the live page. This is a good thing, for if I were to introduce a JavaScript backdoor, it would not affect you. However, you still need to trust that the original that you have cloned did not have backdoors in the first place. Enlist an independent Web Developer to go over the saved page for your own peace of mind.

Developer Notes

The page makes no network requests after it has loaded all images, CSS, and JavaScripts. Execution starts with the init function, during and after which no network requests are made. You can verify this using the Network Inspector.

This simple fact means that the page has no opportunity to steal any confidential data.

The implementation uses Elliptic Curve Diffie-Hellman (ECDH) protocol to establish a shared secret (the long password). The shared secret is 32 bytes long, and it is encoded in Base58 Bitcoin encoding.

The DH-offer is a compressed (x,y) coordinate of a P-256 Elliptic Curve, encoded in Base58 Bitcoin encoding. For a thorough explanation see my article Toward Shorter Encryption Keys on Medium.

The check digits, also known as a Short Authentication String (SAS), are the sum of the bytes of the shared secret byte array, modulo 10000.

Then encryption form uses the AES-256 GCM cipher with tag length of 128. For every message, a random 12 byte nonce is generated and is used as the initalization vector for AES.

The implementation code can be seen in the HTML source code of this page. All JavaScript and CSS is inlined within the HTML, with the exception of helper functions from my WebUtil library.

You can get a barebones page by copying everything between the two markers "START COPYING HERE" and "FINISH COPYING HERE" in the HTML source. I have a script that does that automatically, and you can see the result here.

I encourage you to host this code on your own trusted web host. This page has MIT license.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK