How your private messages on LatePals are end-to-end encrypted, explained in plain words

What "end-to-end encrypted" really means on LatePals, what our server can and cannot see, what the recovery code is for, and how to check that nobody is listening in.

People write things late at night that they would never say in the daytime. That is part of what LatePals is for, and it is also why we think private messages should be really private. Since November, one-to-one messages on LatePals are end-to-end encrypted. Here is what that means, without the jargon, and what it does and does not protect.

What "end-to-end" means

Most websites encrypt the connection between your browser and their server (that is the padlock in the address bar), but the server itself can read everything you send. End-to-end encryption goes further: the message is locked in your browser before it leaves your device, and it can only be unlocked in the browser of the person you are writing to. Our server passes the locked message along and stores it, but it never has the key to open it. If someone broke into our database, or if we were asked to hand over your messages, all there would be to hand over is scrambled text.

Your keys stay with you

The first time you use messages, your browser makes a pair of keys for you. One is public: we keep it on the server so others can write to you. The other is private: it stays in your browser, stored in a way that even the LatePals web page cannot read out as plain data. When you write to a friend, your browser combines your private key with your friend's public key to work out a secret that only the two of you can calculate. Your friend's browser does the same from the other side and arrives at the very same secret. That shared secret becomes the key that locks and unlocks your messages.

For the technically curious: the keys are elliptic-curve keys (ECDH on the P-256 curve), the shared secret is turned into a 256-bit AES-GCM key with HKDF, and every message gets its own random starting value, so two identical messages never look the same once they are locked. All of it is done by the encryption that is built into your browser (the Web Cryptography API), not by code we wrote ourselves, because home-made cryptography is a classic mistake.

The recovery code

There is a catch with keeping the private key only in your browser: what happens when you get a new phone, or open LatePals on your computer? That is what the recovery code is for. When you set up messages, you are shown a code of 20 random characters, once. Your private key is locked with that code (stretched through 150,000 rounds of a function called PBKDF2, to make guessing it slow) before a backup is sent to our server. We store the locked backup, but we never see the code, so we cannot open it. On a new device, you type in your code, your browser fetches the backup and unlocks it, and your messages can be read there too.

This also means that if you lose the code and every device you have used, we cannot get your old messages back for you. That is not a bug; it is exactly what makes the encryption real. Write the code down somewhere safe, away from your phone.

Checking that nobody is in the middle

Encryption only helps if you are really using your friend's key and not someone else's. To check, open a conversation and look at the safety code: a row of 20 digits worked out from both of your keys. If you compare it with your friend, side by side or over a call, and the digits match, then the messages are only between the two of you. If either of you sets up a new key, for example after reinstalling without the recovery code, LatePals tells you that the code has changed, so you can check again.

What it does not protect

  • Who talks to whom, and when. To deliver messages we need to know who they are for, and when they were sent. The content is hidden; the fact that a message exists is not.
  • Your unlocked device. If someone has your phone open in their hand, they can read what you can read. A screen lock is still your best friend.
  • Screenshots and forwarding. Once a message arrives, the person you sent it to can save it or show it to others. Encryption protects the journey, not what people do afterwards.
  • Posts and comments. Only one-to-one private messages are end-to-end encrypted. Things you post on your profile, in groups or on pages are meant to be seen by others.

If someone is abusive

Because we can't read private messages, we can't scan them for abuse either, so it is up to you to tell us. If someone sends you something hurtful or threatening, report their profile and describe in the report what happened, copying in the words they used if you can. Our moderators look at every report, and people who break our rules lose their account. You can read more about how we keep LatePals safe in our community guidelines and our privacy policy, and our five-minute security checkup covers the other half of staying safe: strong passwords and a locked phone.

Sources and further reading

  1. National Institute of Standards and Technology (2007). SP 800-38D: Recommendation for Block Cipher Modes of Operation: Galois/Counter Mode (GCM) and GMAC.
  2. Krawczyk H, Eronen P (2010). RFC 5869: HMAC-based Extract-and-Expand Key Derivation Function (HKDF). Internet Engineering Task Force.
  3. World Wide Web Consortium (2017). Web Cryptography API. W3C Recommendation.

Still up? You're in good company.

LatePals is a free social network for night owls and shift workers. Chat, share and find people who are awake when you are.

Create your free account