Sealbox

Public key cryptography: two keys, and whose key it is

Published

Public key cryptography uses two keys that belong together: a public key you can hand to anyone, and a private key you keep. This guide reads NIST and RFC 9180 for what each key does, how two people agree on a secret without meeting, and how encrypting differs from signing. Then it says where the idea is weakest, and what Sealbox, an iPhone app that seals messages before any channel, does about it.

NIST’s glossary defines it, in the entry from NIST IR 8547, as "Cryptography that uses two separate keys to exchange data — one to encrypt or digitally sign the data and one to decrypt the data or verify the digital signature", and adds "Also known as asymmetric cryptography." In this guide’s reading, the weak point is not the math: a public key does not say whose it is, so at first contact someone has to check that it belongs to the right person.

What public key cryptography is: two keys that fit together

The NIST glossary entry carries several definitions, each quoted from a different document. The one from SP 800-56B Rev. 2 says it is "A form of cryptography that uses two related keys, a public key and a private key; the two keys have the property that, given the public key, it is computationally infeasible to derive the private key." In this guide’s reading, that property is what makes the public half safe to give away: having it does not hand over the other.

Another definition, from NIST IR 8202, describes "A cryptographic system where users have a private key that is kept secret and used to generate a public key (which is freely provided to others)." In this guide’s reading, the keys are made as a pair, and one half is published while the other is not.

Two names cover the same idea. The entry for asymmetric cryptography, also from NIST IR 8547, gives the same definition except for the last sentence, where each entry names the other term: this one ends "Also known as public-key cryptography." The other family, with one key for both jobs, is the subject of our guide on symmetric encryption; this guide leaves it there.

What the public key and the private key are for

RFC 9180, which defines hybrid public key encryption (HPKE), keeps the two roles apart in its notation: "skX is the private key and pkX is the public key". Its most basic function is "to enable encryption to the holder of a given KEM private key", and, in this guide’s reading, the sender needs only the recipient’s public key for that: the encapsulation step, Encap(pkR), takes pkR, the recipient’s public key, as its key input.

NIST IR 8202 puts the signing side in one sentence: "Users can digitally sign data with their private key and the resulting signature can be verified by anyone using the corresponding public key."

How two people agree on a secret without meeting

In this guide’s words, two people who have never met share no secret yet, and the channel between them may be watched. The NIST glossary, in the definition from SP 800-56B Rev. 2, says what public key cryptography changes: for key establishment it "allows different parties to communicate securely" without prior access to "a secret key that is shared", "by using one or more pairs (public key and private key) of cryptographic keys".

One route is key agreement. SP 800-56A Rev. 3 specifies "key-establishment schemes based on the discrete logarithm problem over finite fields and elliptic curves, including several variations of Diffie-Hellman". Its full text defines key agreement as "A (pair-wise) key-establishment procedure in which the resultant secret keying material is a function of information contributed by both participants so that neither party can predetermine the value of the secret keying material independently from the contributions of the other party." In this guide’s reading, the secret is built from what both sides contribute, not chosen by one side and sent to the other.

The other route is key encapsulation, which RFC 9180 describes. The sender’s encapsulation function takes the recipient’s public key and generates "an ephemeral, fixed-length symmetric key" together with "a fixed-length encapsulation of that key that can be decapsulated by the holder of the private key corresponding to pkR". In this guide’s reading, the sender makes a fresh secret, wraps it so that only the recipient’s private key can unwrap it, and sends the wrapped copy.

Encrypting and signing are different jobs

The glossary definition quoted at the top of this guide already names both jobs: one key "to encrypt or digitally sign the data" and one "to decrypt the data or verify the digital signature". In this guide’s reading, the two jobs run in opposite directions. To encrypt, you use the recipient’s public key, and only the matching private key opens the result, so encrypting answers who can read. To sign, the signer uses a private key, and anyone with the public key can check it, so signing answers who made it.

RFC 9180 lists them as separate goals. Among HPKE’s security goals it names "Message secrecy" and, separately, "Sender authentication: Proof of sender origin for PSK, Auth, and AuthPSK modes". In this guide’s reading, the plain mode, Base, which only encrypts to a public key, is not on that list for sender authentication: anyone who holds the recipient’s public key can encrypt to it, so a message encrypted to a public key does not say who wrote it.

Even where HPKE does authenticate the sender with an asymmetric key, the RFC limits what that proves: "This mechanism authenticates only the key pair of the sender, not any other identifier." In this guide’s reading, a key pair is not a person, and that gap is the next section.

The weak point: whose key is it?

Everything above works on keys, and a key is only a number. In this guide’s reading, if an attacker swaps the key you receive for their own at first contact, every step still does what the math says: you encrypt to the key you hold, and its holder reads the message. The cure is outside the math: someone has to confirm that the key belongs to the person.

In this guide’s reading, SP 800-56A Rev. 3 treats the association between a key and its owner as an assumption, not as part of the scheme. Its section 4.1 assumes a trusted association between a party’s identifier and its static public key, and says "The association may be provided using cryptographic mechanisms or by physical means." For how a binding authority makes that association, it says "the means for accomplishing this is beyond the scope of this Recommendation".

It names two ways to build that association. One is a binding authority: the use of cryptographic mechanisms "may require the use of a binding authority (i.e., a trusted authority)", and its example is "a registration authority working with a CA who creates a certificate containing both the static public key and the identifier". The other needs no binding authority: "trusted associations between identifiers and static public keys may be established by the direct exchange of this information between entities using a mutually trusted method (e.g., a trusted courier or a face-to-face exchange)".

In this guide’s reading, there are two shapes of answer: a third party that vouches for the key, or the two people checking it with each other, face to face or by another trusted route. Neither is something the key itself can do.

Beside it: how the app handles keys, and where that stops

Sealbox is an iPhone app (iOS 26+ at launch) that seals messages before any channel. The site says "Coming to the App Store", so this section reports what the site and the project’s code say, not what a store listing shows.

A set of keys, made when you start. The site says "Your identity is a bundle of six public keys — three encryption KEMs, two signing keys, and one composite root identity that certifies the rest (seven in Hardware mode, which adds an ML-KEM-768 key held in the Secure Enclave)", "generated automatically when you start". Per the project’s code, the three encryption keys are P-256, Curve25519 and X-Wing (a hybrid of X25519 and ML-KEM-768, in the site’s words), and the two signing keys are Ed25519 and ML-DSA-65. The decryption keys stay behind biometrics: the site says "only your current biometrics release them" and "There is deliberately no passcode fallback". The site says that as a result, "On a lost phone, even one already unlocked once (AFU), the content stays sealed — an engineering guarantee with no known public bypass, not a formal proof," noting that there is no public key extraction and no known public bypass breaking the Secure Enclave itself from A12 onward. As an additional barrier on top of that against brute force or guessing with physical access to the phone (and what still stands if the Enclave itself is ever broken), the site points to a strong alphanumeric iPhone passcode — and describes the panic gesture to wipe this device's keys, contacts, drafts, and files at once.

The limits. Holding the keys does not tell anyone whose they are: that is the pairing below. And biometrics can be forced: the site lists "Compelled secrets", where "If someone can force your biometrics with the device in hand, or compel your 24-word recovery phrase, they hold the keys". For the panic gesture, the site warns to count on it with the phone unlocked and that deleting the automatic backup copy in iCloud is only a request that depends on the network and does not reach exported files.

Three modes, one scheme. The site says the app has "Three cryptographic modes — all HPKE, all authenticated", the scheme of RFC 9180 read above, for messages to a contact. Quantum, the default, is "HPKE with X-Wing (X25519 + ML-KEM-768 hybrid) + ML-DSA-65 signatures (FIPS 204)"; Classic is "HPKE with P-256 living inside the Secure Enclave + Ed25519 signatures"; Compact is "HPKE with Curve25519 + ChaCha20-Poly1305 + Ed25519". Per the project’s code, each mode selects one HPKE ciphersuite, always in HPKE’s Base mode, and Quantum is the default when none is set. The site says a message to a contact is encrypted, authenticated and bound to the recipient, so that the contact knows it came from you and was meant for them. Per the project’s code, in an epoch message and in the one that opens a session, that authentication comes from the signature, not from the HPKE mode. In this guide’s reading, those two do both jobs from the section on encrypting and signing; for the messages inside a session, the site says they are "authenticated by the session's keys, not by your signature".

The limits. Only Quantum mode is post-quantum. The site says "the message signature is post-quantum only in Quantum", and the project’s security model says that in Classic and Compact a future quantum attacker could forge new messages, though not retroactively, and not the identity, which is composite. This guide does not call those two modes post-quantum and does not say the app is safe against quantum computers: it says what each mode uses.

Pairing, in person or at a distance. The site says keys are exchanged "face-to-face with an animated QR", or "remotely through any channel", and "Pairing is mutual — each side hands its bundle to the other". Scanned in person, a contact "comes in verified"; a remote contact "works immediately" but is marked not verified until you "check a 7-word code, over a phone call or in an encrypted message (sent over a different channel than the one that carried the invite)". The site says the code is good for one pairing only: "whoever swaps the invite in the middle gets a single try at guessing it". Per the project’s code, a contact scanned in person is created as verified, and the 7 words come from combining a secret from each side.

The limits. The site says plainly: "Pair remotely and never compare the security code, and a first-contact man-in-the-middle stays possible"; the not-verified marker stays visible, and sending to that contact "asks for your explicit confirmation". Per the project’s security model, the check protects only if the second channel really is the other person’s: the site says "it does not need to be secret", and that the check "does not hold on a device that is already compromised". In person, the project’s security model says the reading assumes the screen scanned is its owner’s. And the channel still shows who talks to whom: the site lists "Who you talk to, when, how often, that a Sealbox box went by, and how large it is".

View-once with a static outer envelope and off-network transport. In 1:1, the app's default is view-once, where each message's key is destroyed on reading: even under later biometric coercion, already-read history does not reopen. In addition, per the site and the project's cryptographic specification, every view-once message carries an outer HPKE layer sealed to the recipient's static KEM public key — the same encapsulation to the recipient's public key read in RFC 9180 above. Because the matching private key never existed on the sender's device, the sender cannot decrypt from their own phone what they wrote; an attacker who extracts only the sender's phone recovers none of that content and would need to reach the recipients' devices and get past the Secure Enclave, device passcode, and biometrics there. To reduce exposure to remote network attacks such as zero-click spyware, the site also describes carrying the sealed message screen to camera by QR, with no network, including on a dedicated phone in Vault mode.

The limits. View-once holds from the moment of reading, not of sending, and does not erase text the recipient saved to a draft where copying was allowed. Per the project's specification, in Quantum mode with hardware keys that outer layer uses the software X-Wing key — the Secure Enclave (ML-KEM-768) hardware binding of the epoch regime does not extend to it; what protects the inner layer on the recipient's side remains the message key behind biometrics. And operating off-network by QR reduces the perimeter against remote attacks, but does not eliminate the risk, nor does it protect against an already-compromised device in active use.

Sources

Frequently asked questions

What is public key cryptography?

It is cryptography that uses two separate keys to exchange data. According to NIST’s glossary (the entry from NIST IR 8547), one key serves to encrypt or digitally sign the data, and the other to decrypt it or verify the signature. The two are a public key and a private key, and the glossary also calls the field asymmetric cryptography.

What are the public key and the private key for?

In RFC 9180’s notation, a sender encrypts to the recipient’s public key, and the holder of the matching private key recovers the message. NIST IR 8202 adds the signing side: a user signs with the private key, and anyone can verify the signature with the corresponding public key.

How can two people share a secret without meeting?

Public key cryptography lets them establish a key without a prior shared secret. NIST describes key agreement, where both sides contribute to the secret, and RFC 9180 describes encapsulation, where one side wraps a fresh key for the other’s public key. In this guide’s reading, either way they still need to know whose public key they hold.

What is the difference between encrypting and signing?

Encrypting uses the recipient’s public key, so that only the holder of the private key can read the message. Signing uses the signer’s private key, so that anyone with the public key can check it. RFC 9180 lists message secrecy and sender authentication as separate goals, and names sender authentication only for its PSK, Auth and AuthPSK modes.

How do I know a public key belongs to the right person?

In this guide’s reading, the key itself cannot tell you. SP 800-56A Rev. 3 names two ways to build that trust: a binding authority, such as a registration authority working with a certificate authority, or a direct exchange between the two parties, such as a trusted courier or a face-to-face exchange.

Does Sealbox use public key cryptography?

Yes. By the site, your identity is a bundle of six public keys (seven in Hardware mode), and a message to a contact is encrypted and authenticated, recipient-bound, in one of three HPKE modes. In view-once, that same HPKE encapsulation to the recipient’s static public key wraps the outer layer and prevents the sender’s own phone from reopening what they wrote (in Quantum mode with hardware keys, that outer layer uses software X-Wing). A contact scanned in person comes in verified, which, per the project’s security model, assumes the screen scanned is its owner’s; a remote one stays not verified until you check a 7-word code, and without that check a first-contact man-in-the-middle stays possible.

Get notified at launch

No form, no list, no tracker — it's just email. If the button doesn't open your mail app, write to support@sealbox.io with the subject "Notify me".

Full reference

Coming to the App Store · iOS 26+