Keys: which type to choose, and how to keep them safe
Everything in CryptoPad rests on keys. This guide explains what a key is made of, which of the three types to pick, how to be sure a contact's key is really theirs, how to move keys to another phone, and what happens when a key is gone. It applies to iPhone and Android alike.
This guide names the buttons as version 0.9 shows them.
Two parts: one you keep, one you give away
Every key you make in CryptoPad is a pair.
- The private part stays on your phone. Only it can open messages encrypted for you. The app never shows it, never puts it on the clipboard and never sends it anywhere. It leaves the phone only when you send it out yourself, and then only encrypted: from version 0.6 in an export file you make, under a password you choose, and from version 0.8 (build 11 on Android, build 8 on iPhone) by QR code to a new phone of your own, as described below.
- The public part is what Copy Public Key gives you (and, from version 0.8, what Show QR Code shows). Send it to anyone you like: it can only encrypt messages for you, never decrypt them.
A message encrypted for someone can be opened only by the private part of their key. Not even the sender can read it again once it is encrypted.
The name you give a key is only a label for you. It is not part of the public key, and nobody you send the key to sees it.
Which type to choose
CryptoPad makes three types of key. All three encrypt and decrypt, and all three work between iPhone and Android: a message encrypted on one opens on the other, whatever the type.
| Type | What it is | Good to know |
|---|---|---|
| RSA | RSA with a 4096-bit key | The longest public key and the longest messages; takes a few seconds to make. |
| NIST | Elliptic curve P-256 | Short and made at once. Works on every supported phone. |
| X25519 | Elliptic curve X25519 | Short, made at once, and the shortest messages. The default in both apps. |
If someone you write to still uses CryptoPad 0.5 on Android 12 or older, give them an RSA or NIST key, not an X25519 one: that version cannot encrypt for X25519 there. Every current version of both apps works with all three.
The person writing to you does not need a key of the same type as yours. Each of you encrypts for the other's key, whatever its type.
Several keys
You can have as many keys as you like — for example, one per group of people, or a new one when you want to stop using an old one. You never choose which key to decrypt with: CryptoPad tries all of yours.
A contact holds one public key. If someone gives you two keys, add them as two contacts with different names.
Adding a contact by pasting a key
From version 0.8 a pasted key is checked as strictly as a scanned one, in the same way on iPhone and Android, so that a broken or doubled key is refused when you add it rather than found broken later:
- What is accepted. A public key as Copy Public Key gives it, the same key wrapped over several lines or with spaces around it, or an X.509 certificate. Of a certificate, only the public key in it is kept; nothing else in the certificate is checked or trusted — comparing the fingerprint is the check.
- What is refused. A private key (the field is emptied at once: whoever sent it should make a new one), more than one key, an incomplete key, a key type CryptoPad cannot use (it takes RSA of 2048 to 4096 bits, P-256 and X25519), and a key that another contact already has — CryptoPad names that contact.
- Your own key is allowed. Add one of your own public keys as a contact to encrypt messages and files to yourself — to keep them in a messenger's saved messages, for example, or to try CryptoPad on your own. CryptoPad notes “This is your own key …”, and that is all.
- One form for every key. The key is saved in one standard form, the same as when you scan it or import it. Contacts you added before version 0.8 are not changed and work as before.
Make sure a key is really theirs
A public key travels through ordinary channels — a chat, an email. Someone who controls that channel could swap it for their own and read what you encrypt "for your contact". So before you trust a contact's key, compare it with the person through a different channel: side by side when you meet, or read aloud on a call. Compare the whole key, or at least a long stretch from its middle — not the first or last lines, which look alike for every key of the same type (every RSA key ends the same way). From version 0.8 it is easier: compare the key's fingerprint, as described below. For a contact you already have, however it was added, open its menu (⋯ on iPhone, ⋮ on Android) and tap Show Fingerprint; compare all 20 characters with the fingerprint their phone shows under Show QR Code for their key, in person or on a call where you know their voice.
Do the same for your own key: tell people which key is yours.
Exchange keys by QR code
From version 0.8 you can hand over a public key face to face, with no chat or email in between. On one phone, open the key's menu (⋯ on iPhone, ⋮ on Android) and tap Show QR Code; on the other, tap Scan QR Code on the Contacts tab and point the camera at the code. Both phones need CryptoPad 0.8 or later; iPhone and Android read each other's codes. The steps are in the guide for your phone.
- What the code holds. Only the public part of the key — no name, never the private part. Anyone who sees or photographs it learns nothing they could not get from a copied public key, so it is safe to show. CryptoPad shows a QR code only for your own keys, not for a contact's.
- The fingerprint. Both screens show a Fingerprint: 20 letters and digits in five groups, worked out from the public key itself. The same key always has the same fingerprint, on iPhone and on Android. Read all 20 characters aloud and check them against the other screen before you add the contact — not just the first group, which someone could match with a key of their own. When they all match, the key you scanned is the one on the other screen, and the check described in the section above is done.
- The camera. It is used only while the scanner is on screen, and what it sees is never saved or sent. The phone asks for it the first time you tap Scan QR Code. Without it, adding a contact by pasting their key works as before.
Moving keys and contacts to another phone
From version 0.6 you can move a key — or everything: all your keys, your contacts and your App lock setting — to another phone yourself, between iPhone and Android in any direction:
- On the old phone, export. One key: its menu (⋯ on iPhone, ⋮ on Android), then Export…, which makes a key export file. Everything: Export All…, in Settings on iPhone (the gear button) or in the ⋮ menu at the top on Android, which makes a full export file.
- Confirm it is you. If the phone has a screen lock, it asks for it — Face ID, fingerprint or passcode.
- Choose a password, at least 12 characters, and type it twice. The file is encrypted with it.
- Save the file where the phone's save dialog lets you: on the phone, on a memory stick, in your cloud storage.
- Bring the file to the new phone, however you like. Keep the password to yourself, and never send it along with the file.
- On the new phone, import. Tap Import Key on the Keys tab (or Import…), pick the file and type the password. CryptoPad shows what the file holds; choose what to take and tap Import.
Everything in the file, names included, is encrypted. Anyone who gets the file can see only its name and size; anyone who has the file and the password can use your keys and see your contacts. So pick a password nobody can guess, and delete the file once you no longer need it. A forgotten password cannot be recovered — not by you, not by us.
Version 0.5 and older cannot make or import export files.
Move a key to a new phone by QR code
From version 0.8 — build 11 on Android, build 8 on iPhone — one X25519 or NIST key can go from your old phone to a new one by two QR codes, with no file and no password, between iPhone and Android in any direction. Both phones need this build or later. The steps are in the guide for your phone; in short:
- On the new phone, Receive Key (on the Keys tab). It shows a QR code that holds only a one-time public key, made for this transfer.
- On the old phone, Send Key in the key's menu (⋯ on iPhone, ⋮ on Android). The phone asks for its unlock, as for an export, then the camera scans the new phone's code.
- Type the number the old phone shows — six digits — into the new phone.
- Compare the check code. Both phones now show a Check code of six characters. Tap Yes on the old phone only if they are the same.
- Scan the key. The old phone shows a second QR code; on the new phone, Scan Key reads it. Check that the fingerprint matches the old phone's, change the name if you like, and tap Save.
- Why the check code. Someone could try to put their own code in front of the old phone's camera instead of your new phone's. The check code is worked out from the code the old phone scanned and from the number it chose only after scanning it, so a substituted code gives a different check code. If the two differ — and the number was typed right — tap No: nothing is sent.
- What someone filming the screens gets. Nothing they can use. The second code is the key encrypted (X25519, HKDF-SHA256, AES-256-GCM) to the one-time key of the new phone, which never leaves its memory and is forgotten as soon as the key has arrived — after 5 minutes at the latest.
- Only to a phone of your own. Whoever receives a key can read everything encrypted to it. Never type a number or confirm a check code because someone asks you to.
- One key at a time, and it stays on the old phone. Delete it there if you no longer want it there. Several keys, contacts and settings go in a full export file; an RSA key, or a key for a phone that is not side by side, goes in a key export file, as in the section above.
Language
From version 0.9 CryptoPad is in English, Русский, Deutsch, Español, Polski and Čeština, on Android and on iPhone. Choose it in the app under Settings, Language, the first row. Your keys are the same in every language: the language changes only what you read on the screen.
Light or dark
From version 0.9 — build 13 on Android, build 10 on iPhone — CryptoPad can also be light or dark whatever the phone uses: in Settings, Theme, the row under Language. Like the language, it changes only how the screen looks, never your keys; it is kept on that phone only and is not part of a full export file. Section 16 of the Android guide and of the iPhone guide shows how.
When a key is gone
A private part can be used only on the phone that made it, or on a phone you moved it to with an export file or by QR code. Nobody else — including us — can move it or open a copy of it, so a lost key you never exported cannot be recovered. What a phone backup may contain is in the privacy policy.
- Deleting a key is final, unless you exported it first and still know the file's password. Messages encrypted for it can no longer be opened, by anyone.
- Deleting the app makes all your keys unusable, apart from those you exported. On Android they go with the app at once. On iPhone, if you want them gone at once, delete them in the app before you delete the app.
- A new phone does not bring your keys along by itself, on either platform: export them on the old phone and import them on the new one, or send them one at a time by QR code, as described above. Or make new keys on the new phone and send your contacts their public parts; messages encrypted for the old keys then open only on the old phone, while it still has them.
When you replace a key, send the new public part to the people who write to you, and ask them to replace your old key in their contacts.
More answers are on the Support page.