Settings

1. Make a key pair

Do this on the machine that will receive messages. Share the public key; keep the private key.

Public key, safe to share
Private key, keep this

2. Encrypt to someone's public key

3. Decrypt with your private key

How it works

What is actually happening to your message

Both modes end in AES-256-GCM, which is the encryption the browser itself ships and the same primitive that protects the connection you are reading this over. What differs is how the key for it is arrived at.

  • Passphrase mode stretches what you typed with PBKDF2-SHA256 over 310,000 iterations against sixteen random bytes of salt, and uses the result as the key. The iteration count is written into the message, so a message made today still opens if the number is raised later.
  • Key-pair mode generates a fresh ECDH key pair on the P-256 curve for every single message, agrees a shared secret with the recipient's public key, and runs it through HKDF-SHA256 to get the key. The ephemeral public key travels with the message; the ephemeral private key is discarded the moment it has been used.

The output is base64 wrapped in an armour block, so it survives being pasted into a mail client, a chat window, a ticket, or a text field that would otherwise mangle it. GCM authenticates as well as encrypts: a message that has been altered by so much as one character fails to open rather than opening as plausible nonsense, so you find out.

The passphrase is the weak part, and nothing here changes that

Nobody attacks AES-256. They attack the passphrase, by guessing, and the only question is how many guesses per second they get. Those 310,000 iterations are what make each guess expensive: they turn a few billion attempts a second into a few thousand. That is an enormous improvement and it is not a substitute for a passphrase worth guessing against.

Four or five unrelated words chosen at random beat one memorable word with letters swapped for digits, by an amount that is hard to overstate: the swaps are in every cracking dictionary and have been for twenty years. The strength meter on this page is an estimate of that, not a guarantee.

And then there is the question the mathematics cannot answer: how the passphrase reaches the other person. Sending it in the same channel as the message means an attacker who has the channel has both, and you have achieved nothing. Say it on the phone, hand it over in person, or use key-pair mode, which exists precisely so there is no shared secret to transport.

What it hides, and what it does not

The armour block is visibly an encrypted message. Anyone who sees it knows that you sent something, to whom, at what time, roughly how long it was, and which mode you used. If the fact of the communication is the sensitive part, encryption of the content does not help you; that is a different problem with different answers.

Key-pair mode does not prove who sent a message. Your public key is public, so anyone holding it can encrypt something to you, and there is no signature in the envelope to say who did. It protects the contents from everybody except the holder of the private key. It does not tell that holder who they are hearing from.

If you are choosing between this and a proper messenger, use the messenger. Signal and its equivalents verify keys, rotate them, and protect past messages if a device is later seized, and this does none of those things. CIPHER is for the case where you are stuck with a channel you do not trust (a corporate mail system, a support ticket, a forum message, a USB stick) and need the contents to be unreadable while they sit in it. For a file rather than a message, CAPSULE makes an encrypted file anyone can open in a browser, KEYRING does it with age keys, and SHADOWKEY makes a passphrase worth using.

For whoever came from HEX. -----BEGIN OBSCURA MESSAGE----- T0JTQwEBAAS68JmITaDHlafmhPcONqqC4nGXmrE+xnlK3A6surrWRUZqNY2eqedl qyRiP8YJIZIt76hK/B3CsqWvCFIy3TLIdbWl7Npd6k/jcg== -----END OBSCURA MESSAGE-----

The guide: Send a file without it sitting on a server

Questions people ask about CIPHER

How can I send a message securely when neither of us wants to install anything?

Encrypt the text into a block of characters and send that block through whatever channel you already use. The recipient pastes it into the same page and gets the message back. What has to travel by a different route is the passphrase, or in key mode only the public key, which is safe to send in the open.

What does encryption in a browser actually protect?

The contents of the message, in transit and wherever it comes to rest. It does not hide that you sent something, who you sent it to, when, or how long it was, and it cannot help if the device at either end is already compromised. Encryption protects the message, not the fact of the message.

Should I use a passphrase or a key pair?

A passphrase is simpler and is right for a one-off to someone you can reach by another route. Its weakness is that anyone who copies the encrypted block can guess at the passphrase offline for as long as they like, so it needs to be several unrelated words. A key pair removes the shared secret: the recipient publishes a public key, you encrypt to it, and only their private key opens the result.

What encryption does CIPHER use?

The encryption built into your browser. Messages are sealed with AES-256-GCM. In passphrase mode the key comes from PBKDF2 with 310,000 rounds of SHA-256. In key mode the pair is ECDH on P-256. Nothing is stored here: not the message, not the passphrase, not the keys.

What happens if I lose my private key?

The messages encrypted to it can never be read again, by you or by anyone. The private key is the only thing that can open what was sent to its public key, and it is not stored anywhere, so keep your own copy. The public key is safe to give to anyone who writes to you.

Doing this often? The OBSCURA Sovereign Suite seals whole files for the person with the passphrase, and locks a file so it takes several people to open. On its own, US$2 a month; with everything else, US$5 a month or US$48 a year.