Hibbem

How Hibbem works

Your texts still travel as ordinary SMS. Hibbem encrypts them on your phone before they leave and opens them on the other phone. There is no server in between: everything on this page happens on the two phones.

Setting up, once per contact

Before two phones can text in secret, they agree on keys that only they know. Hibbem offers two ways. Both end with the same thing: a session that gives every message its own key.

Verifying in person

2 texts · verified at once

  1. AnnaBobStanding together, both open their chat with the other and tap Verify in person.
  2. SMSEach phone texts the other's number a random code, valid for 15 minutes.
  3. AnnaHer phone shows its keys, signed and carrying the code Bob's number sent, as a QR code, by an NFC tap or as sound.
  4. BobHis phone checks that the code it texted came back. That proves this phone receives Anna's texts: a sender's number can be faked, receiving someone's texts can't.
  5. BobAnnaBob's phone answers the same way, and Anna's checks his code. Both are now encrypted and verified.

A photo of an old QR code is useless: codes are used once. By sound, anyone in the room could listen in, so the phones then also ask you to compare a safety number.

Setting up over SMS

About 23 texts · encrypted, not yet verified

  1. AnnaTaps Set up encryption. Her phone sends its public keys in 12 texts, signed, with the time and the number they're meant for.
  2. BobHis phone puts the pieces together in any order and checks the signature. A setup older than 3 days, from the future or meant for another number is refused or comes with a warning.
  3. BobSees “Anna wants to encrypt this chat”. Nothing is sent until he taps Accept.
  4. BobHis phone answers with its own keys in 11 texts. Both phones now work out the same session key, which never travels.
  5. SMSA lost piece? From someone you already text with, the phone asks for it again after 3 minutes; it comes back with different bytes, so a carrier filter that drops repeats lets it through.

Encrypted, but someone able to intercept and replace texts on the network could sit in between. Compare safety numbers, or verify in person later: that costs just two texts.

Sending a message

From your words to the other phone

Up to 64 bytes of text in one SMS · compression often fits twice that

  1. AnnaHer phone puts the message in a sealed box: what kind it is (text, drawing, voice note, secret) goes inside the encryption, and it's padded so every text is a full 160 characters.
  2. AnnaIt encrypts with a key used for this one message only (Double Ratchet, AES-256-GCM), and saves the new key state before sending, so a key is never used twice.
  3. SMSThe texts travel as ordinary SMS and may arrive in any order.
  4. BobHis phone collects the pieces, opens the message and stores it in one step: if anything fails, nothing changes and nothing is lost.
  5. BobThe text is kept in Hibbem's own encrypted storage. Other apps that can read SMS only see “🔒 Encrypted message”.

A missing piece is asked for again after 3 minutes, in an encrypted request, and only from people you already text with.

What's inside one text

From the SMS the carrier sees, down to your words.

1

The SMS

A normal text of 160 GSM-7 characters (never emoji or accents, those would cut it to 70). Every encrypted text is exactly 160: its length says nothing.
#wmarker
Base64 of the frame, no paddinge.g. #wKldLAXyqhaO8M2JQ…
last character4 spare bits = major version (2)
2

The frame

One byte says what it is. A long message is split over several texts that may arrive in any order.
byte 0version (3 bits) · multipart (1) · type (4)
only if multipartmessage id (3 bytes) · index · total
payload≤ 117 bytes in a single text · ≤ 112 per piece (up to 255 pieces)
Every encrypted message is type 10, sealed, and fills its texts. Missing pieces are asked for again after 3 minutes, encrypted; a resent piece is masked (type 8) so carrier filters that drop identical texts don't drop it again.
3

The encrypted payload type 10

Double Ratchet: every message has its own key, AES-256-GCM. 52 bytes of overhead. The frame's byte 0 is authenticated too: a relabelled frame doesn't open.
ratchet keyX25519 public key · 32 bytes
pn · n2 + 2 bytes
ciphertextcontent · 0x80 · zeros to the end of the last text
GCM tag16 bytes
So one text holds 64 bytes of your words (117 − 52 − 1 for the padding mark); two hold 171, every further text adds 112. Compressed, about twice as many words fit.
4

The plaintext only the two phones see this

What the ciphertext opens into: the first byte says what it is, inside the encryption.

A text

Your words as UTF-8, no kind byte (0x00 first only if the text starts with a control character).
  • Game moves are ordinary texts too: 🎮 Checkers 12. 32-28
  • A longer text may go as kind 4 instead (compressed)

7 · Voice note

7 | version | mode | frames | Codec2 bits
  • 700C: 28 bits per 40 ms
  • at most 15 s

8 · Request

which pieces of a message to send again (no chat line)

1–5 · Attachments

kind (1 byte) | data
  • 1 drawing: 128×128 grid, strokes packed in bits (1–10 texts)
  • 2 song: style · generator · seed = 11 bytes, 1 text
  • 3 disappearing-messages timer, with the sender's time
  • 4 compressed text, when that saves a text (~30% fewer texts)
  • 5 one-time secret: seen once, then gone from both phones

10 · Shared list

a checklist both phones keep in step

9 · Several items

9 | head | length | data | … | last item
  • head: kind (5 bits) · last · skippable
  • 11 reply to a message, 12 reactions
  • 13 the sender's Hibbem version, once a day; skippable: a phone that doesn't know it leaves it out
  • 31 continuation: the real kind follows, for kinds past 30
  • a kind a phone doesn't know yet is kept and shown after an update

Every frame type

2Setup INIT · 1327 bytes = 12 texts (time, meant-for number) public keys, signed
3Setup RESPONSE · 1227 bytes = 11 texts public keys, signed
4Resend request for setup pieces
6In-person code (8 bytes)
8Masked resent piece
10Sealed: every encrypted message encrypted
12Resume: a restored phone and its contact start a fresh session (57 + 53 bytes, one text each way) authenticated
1 · 7 · 9Hibbem 1.x's text, voice note, attachment: no longer read since 2.0.103
13–15Not used yet: "needs a newer Hibbem"

What is not hidden

  • Who texts whom, and when: the carrier still sees the numbers and times.
  • How many texts a message takes (not its length within them; compressed: also a little of what kind of text).
  • The major version bits.
  • Setup texts carry public keys, their time and the number they're for: safe to see, but not secret.
Everything that says what you sent (text, voice, drawing, song, list, reply, reaction, timer, secret, a request, even which Hibbem version you use) is inside the encryption: every encrypted text looks the same.

Sizes in bytes before Base64. The full description is PROTOCOL.md in Hibbem's source code.