How Pyral keeps things private
The short version. What you share is locked on your phone with keys that only you and the people you share with hold. Our server passes the locked package along and never has the key. A message is deleted from the server once it is delivered; a photo or file stays there, still locked, for 30 days at most.
Encrypted on your phone, opened on theirs
When you send a message or a photo, your phone encrypts it before it leaves. The only phones able to decrypt it are the ones belonging to the people you sent it to. This is called end-to-end encryption: the two ends are your phone and your friend's phone, and nothing in between can read what passes.
The server in the middle, which we call the relay, exists because two phones are rarely online at the same moment. It holds a sealed message until your friend's phone collects it, then deletes it. Photos and files stay sealed on the server for 30 days, so everyone they were sent to can fetch them. Anything not collected is deleted after 30 days.
Your content lives on phones, not on our server
Most services keep your messages and photos on their servers for good. Pyral does not. After delivery, the only copies are on your phone and on the phones of the people you shared with. On your phone everything Pyral stores is encrypted again, with a key held in the iPhone's secure storage and released by Face ID or your passcode. If you set a PIN or password for Pyral, the key is derived from it, so the data cannot be read without it.
Searching your chats happens on your phone; nothing you search for is sent to us. Who an @mention is for, and which chats you have silenced, are worked out from secrets the server never has.
What keeps working while Pyral is locked
Photos and videos that are still sending have to keep going while Pyral is locked. They keep a small store of their own, encrypted with a key that is available once your iPhone has been unlocked since it was switched on, without Face ID or your Pyral PIN. It holds which uploads are still going. Nothing from your chats or albums is in it, and it is never backed up.
It also holds a limited key for our server. That key can only send sealed files. It cannot read, send or delete your messages.
Parties don't need it. Invitations, joining, leaving and the end time all travel as ordinary encrypted messages, and nothing about where anyone is goes anywhere.
Checking you are talking to the right person
Encryption only helps if the keys belong to who you think they do. Pyral gives you three ways to be sure:
- Scan their code in person. Adding a friend by scanning the code on their phone confirms their keys directly, with no server involved.
- Compare a safety number. Each pair of friends has a number that is the same on both phones only if nobody is in the middle.
- Check by text. You can text a friend a link from your own phone to the number you already have for them; when they tap it, Pyral confirms the account is theirs.
If a friend's keys ever change, which happens when they get a new phone, Pyral tells you and asks you to check before it shares anything from your history with the new phone.
What the server can see
A server that delivers messages has to know where to deliver them. We would rather say so than let "we can't read your messages" be heard as "we know nothing".
| The server holds or sees | Why |
|---|---|
| A scrambled fingerprint of your Apple account identifier | So that signing in again reaches the same account. The identifier itself is not kept. |
| A scrambled fingerprint of your username | So a friend who types your exact username can find you, and nobody else can take it. The username itself is not kept, and your display name never reaches the server: both travel between friends, encrypted. |
| Your public keys | So others can encrypt to you. Public keys are meant to be shared; the private halves never leave your phone. |
| Who a sealed package is for, when it arrived, and its rounded size | Unavoidable for delivery, and deleted once it's delivered (30 days at most). When you message a friend, the server isn't told who sent it: the sender is sealed inside the encrypted message. Messages between friends and in groups go to random mailboxes that aren't linked to your account, so for those, who it's for is a mailbox, not an account. The server can see that some mailboxes are in a group together. |
| Friend requests to people who don't know you yet | These are sent the ordinary way: the server sees who sent the request to whom, until it's delivered. Once you're friends, your messages are sealed. |
| Encrypted messages awaiting delivery, and encrypted files | Messages until collected, files for 30 days at most. The server has no key for them. |
| A scrambled tag for each chat you silenced or set to ring only for @mentions | So we know not to ring your phone. The tag is made from a secret we never have, so we can't tell which chat it is. When a message mentions you, the sender's phone tells us, so it can still ring. |
| Party updates from older versions of the app | Versions before the current party mode could send sealed, rough location updates to the friends they picked. We can't open them; we can see that they are party traffic, and who sent one to whom. Deleted within an hour. The current app sends none. |
| A fingerprint of a limited key for when Pyral is locked | So photos keep sending. That key can only send sealed files, and, from older versions of the app, those party updates. |
| A notification token for your iPhone | To wake your phone when something arrives. The notification itself carries no content. |
| When your account was made, and the app version it last opened | To run the service and to tell you when an update is needed. |
| A scrambled fingerprint of an invited friend's email address, and for up to three days of their phone's network and settings | So that you become friends as soon as they join. Deleted when they join, and after 30 days in any case. |
| Your connection's internet address | Every internet service sees this while you are connected. We do not keep a record of it against your account. Our server keeps no log of requests, and we have switched off the request logs our host offers. |
The relay runs on Cloudflare, which also keeps the sealed files, and its database is with PlanetScale, in the eastern United States. Your phone sends and fetches the sealed files directly from Cloudflare's storage, with a link the relay gives it that works for a few minutes, so the storage sees your phone's IP address as the relay does. None of them has a key to anything you share.
When you message a friend, Pyral's servers aren't told who sent it. The sender is sealed inside the encrypted message. For messages between friends, the server stores who a message is for, when it arrived and its size, until it's delivered (30 days at most), but not who sent it, and messages between friends and in groups are delivered to random mailboxes that aren't linked to your account. We can see that a random mailbox received messages, when and how big, and that some mailboxes are in a group together. Someone watching our servers live could still guess some connections from timing, and friend requests to people who don't know you yet are sent the ordinary way.
Nothing to hand over
Some services publish a "warrant canary", a notice that disappears if they are forced to hand over what their users have stored. Pyral does not need one for your content, because your content is never on our server in a form anyone can read and the keys never leave your phone. We cannot be made to produce what we do not have, whether by a court, by someone who breaks into the server, or by ourselves.
What could be obtained from us is the table above and nothing more: that an account exists, a fingerprint of its username, and sealed packages still waiting: when and how big, and whom or which mailbox each is for. For messages between friends, not who sent them. Who you block is not on the server at all: your phone drops what a blocked person sends.
What Pyral cannot protect you from
- The people you share with. Someone who can see a photo can photograph their screen with another device. Pyral hides protected content from screenshots and screen recording where iOS allows, and can stamp the viewer's name on protected photos, but it cannot stop a second camera. And a copy you let a friend save to their own photos or files is theirs: taking something back, or no longer being friends, removes it from their Pyral but not from there.
- A phone that is unlocked in someone else's hands, unless you have set a Pyral PIN or password.
- A phone that has itself been compromised by malicious software.
- Requests to delete that never arrive. Taking something back asks the other phone to remove it. It works on any phone running the real Pyral app, the next time it connects.
The encryption, for those who want the detail
Pyral follows published, widely used designs: a key agreement in the style of X3DH to start a conversation, the Double Ratchet so that each message has its own key and old keys cannot open new messages, and sender keys for groups. Files are encrypted with AES-256-GCM under a fresh key for each file. Key agreement is X25519 and signatures are Ed25519. Every one of these algorithms is supplied by Apple's own cryptography library on the iPhone; Pyral does not ship its own versions of them.
The way these pieces are combined is Pyral's own code, and that code has not yet been independently reviewed. We say this plainly because you deserve to know it. As Pyral grows, we plan to have it reviewed by an outside security firm, publish what they find, and make the encryption part of the code available for anyone to read.
If you want to leave
You can delete your account from inside the app at any time. Before it goes, Pyral walks you through handing over any groups you run and taking back what you shared, group by group. Deleting removes your account, your username and everything the server holds for you. Messages you already sent still wait to be delivered, 30 days at most, and the fingerprint of your username is held back from others for 30 days.
Questions about any of this are welcome at security@pyral.app.