ATSAM Protocol

ATSAM Protocol: Raven's layered security architecture.

ATSAM (Anchored Transient Stealth Authentication Mechanism) is Raven Messenger's open-design security protocol. Available since v2.0. It is a layered protocol covering every Raven communication path: offline Bluetooth mesh and the libp2p internet bridge that hands traffic between mesh and the internet. ATSAM combines post-quantum hybrid pairing, private nearby discovery, live device confirmation, encrypted routing with rotating per-message tags, and optional Vault Mode for one-time-pad content protection. The result: message content and identity metadata are protected whether the conversation travels over nearby devices or across the public internet through a relay-only bridge node, Post-quantum protection activates per contact, once you and that contact complete a pairing exchange.

What is the ATSAM protocol?

ATSAM (Anchored Transient Stealth Authentication Mechanism) is the open-design security protocol behind Raven Messenger. It is a five-layer stack that performs (1) post-quantum hybrid pairing using X25519 combined with ML-KEM-768 (NIST FIPS 203), (2) private peer discovery via bilateral beacon encryption, (3) live device confirmation through a fresh challenge-response, (4) encrypted routing with rotating per-message recipient tags, and (5) optional Vault Mode using one-time-pad content protection for sensitive text. ATSAM applies uniformly to Raven's two communication paths: offline Bluetooth mesh and the libp2p internet bridge that hands traffic between mesh and the internet.

Acronym
Anchored Transient Stealth Authentication Mechanism
Used by
Raven Messenger (raven-messager.com), v2.0+
Default state
Hybrid pairing available; activates per contact after a pairing exchange
Type
Layered messaging security protocol
Layers
Pairing · Discovery · Confirmation · Routing · Vault Mode
Paths covered
Offline Bluetooth mesh, libp2p internet bridge
Public docs
github.com/Raven-offline-messenger/raven-security

ATSAM protects a contact once you pair with them.

ATSAM's hybrid pairing ships in Raven v2.0. Post-quantum protection is established per contact: you and that contact complete a pairing exchange, and from then on messages between you are sealed under a hybrid X25519 + ML-KEM-768 root. Until a pair is completed, messages to that contact use Raven's Noise-based encryption, which is still end-to-end encrypted but not post-quantum.

How to pair a contact
Open Raven → Settings → Security → Pair a device. Publish your bundle, enter your contact's user ID, and run the pair. Your contact accepts the pending request on their device.
Confirm it worked
Compare the 30-digit safety number with your contact out of band. If the digits match on both devices, the pair is genuine and no machine-in-the-middle substituted a key.

Two additional content-layer add-ons (PROXIMA-VAULT for one-time-pad text and PV-Stealth for rotating envelope tags) ship off by default; they are optional and require explicit per-conversation opt-in.

Most messengers assume the internet is always available. Raven does not.

Traditional messengers rely on cloud servers to route messages and mediate identity. Raven is different. It is designed to keep trusted users connected even when the internet is unavailable, using nearby devices as part of an offline mesh. This requires more than ordinary end-to-end encryption. Raven must also protect how devices discover each other, confirm nearby peers, and route messages without exposing stable identities.

Five layers. Each with a precise job.

ATSAM is not a single encryption algorithm. It is a layered security stack designed for Raven's online and offline architecture. Each layer has a precise job: pairing trusted devices, discovering nearby peers privately, confirming that a peer is live, routing messages, and protecting highly sensitive content through optional Vault Mode.

What ships today, and what does not. ATSAM is a five-layer design. Two layers are live in the shipping app: post-quantum hybrid pairing, and hashed identity tokens on mesh envelopes. Three are implemented and tested but not yet wired into the message path: bilateral beacon discovery, rotating routing tags, and Vault Mode. Each layer below is labelled accordingly. We would rather tell you this than let you assume protection you do not yet have.

1

Post-Quantum Hybrid Pairing

Establishes a shared root secret using classical and post-quantum cryptography combined.

Layer 1 · Live
2

Private Peer Discovery

Paired devices recognize each other. Strangers see only random-looking radio noise.

Layer 2 · In development
3

Live Device Confirmation

A fresh challenge confirms a peer is actually present before the UI shows "nearby".

Layer 3 · In development
4

Encrypted Mesh Routing

Mesh relays forward encrypted envelopes without learning the recipient's identity.

Layer 4 · Partly live
5

Vault Mode

Optional one-time-pad protection for the most sensitive text messages.

Layer 5 · In development

Five primitives, composed honestly.

1. Post-Quantum Hybrid Pairing

When two users establish trust, Raven creates a shared root secret using a hybrid of classical elliptic-curve cryptography and post-quantum key establishment. This gives Raven a stronger foundation than relying on one cryptographic family alone.

Hybrid root Strong floor

2. Private Peer Discovery

Raven devices need to find trusted friends nearby without broadcasting names, phone numbers, public keys, or stable identifiers. ATSAM's discovery layer allows paired devices to recognize each other while making discovery beacons appear random to strangers.

Candidate discovery only

A beacon match does not immediately prove that a peer is live. Raven confirms liveness in the next layer.

3. Live Device Confirmation

After a possible nearby peer is detected, Raven performs a fresh challenge-response confirmation. This prevents old recorded beacons from being replayed to falsely show that a friend is nearby.

Helps prevent replay-based false presence

4. Encrypted Routing (mesh + internet bridge)

When messages move through nearby devices or a relay-only bridge node, no relay should learn who the final recipient is. What ships today: mesh envelopes carry hashed identity tokens — HMAC-SHA-256 of the user ID, truncated to 96 bits — in place of raw identifiers, and the message body is opaque to every forwarder.

Two honest limits. The token is derived under a fixed, public salt and does not rotate, so it is stable per user: a relay that sees the same token twice can tell it is the same person, and can observe that token X repeatedly talks to token Y. And on the internet bridge path the recipient's user ID is currently passed to the relay in the clear. Per-message rotating tags — the design that removes both limits — are implemented but not yet wired into the shipping message path.

Hashed identity tokens (live) Rotating tags (in development) Same construction for mesh and internet bridge

This reduces metadata leakage but does not hide timing, traffic volume, or long-term correlation of a stable token from a persistent observer.

5. Vault Mode for sensitive messages

For selected high-sensitivity text messages, Raven can use Vault Mode. Vault Mode is based on one-time-pad content protection, which can provide information-theoretic secrecy when strict conditions are met: the pad must be random, secret, long enough, and never reused.

Information-theoretic under strict conditions

Vault Mode is for small text or structured messages, not media files.

The mathematics of ATSAM pairing.

Everything below is what the shipping code actually computes. If you find a discrepancy between this page and the source, the source is authoritative and we want to hear about it: info@raven-messenger.com.

Notation

is concatenation. LP(x) = uint16_be(|x|) ‖ x is a length-prefixed field. is the empty string. A is the initiator, B the responder. All HKDF is HKDF-SHA-256 (RFC 5869), extract-then-expand.

1. Two independent shared secrets

Each side computes a classical and a post-quantum secret. Both are 32 bytes.

Z_X   = X25519(sk_self , pk_peer)                    (RFC 7748)
Z_PQ  : (ct, Z_PQ) ← ML-KEM-768.Encaps(ek_B)          (FIPS 203, initiator)
        Z_PQ       ← ML-KEM-768.Decaps(dk_B, ct)      (FIPS 203, responder)

X25519 gives Z_X its security from the elliptic-curve Diffie–Hellman problem; ML-KEM-768 gives Z_PQ its security from Module-LWE, which is not known to fall to Shor's algorithm.

2. The transcript

Every value that influenced the handshake is bound into one hash. Every variable-length field is length-prefixed and every other field is fixed-width, so the encoding is injective: no two distinct field sequences serialise to the same byte string.

T  = D_transcript ‖ version ‖ suite
     ‖ LP(pk_A^X) ‖ LP(pk_B^X)
     ‖ LP(ek_A)   ‖ LP(ek_B)   ‖ LP(ct)
     ‖ LP(context) ‖ nonce₃₂
     ‖ LP(id_A)   ‖ LP(id_B)   ‖ hybridRequired

th = SHA-256(T)

Why the identities are in there. id_A and id_B are the two users' identifiers, placed in fixed initiator/responder slots. Without them, the same key material could be replayed across a different pair of people. With them, A and B must agree on who they think they are talking to or the transcripts differ, the roots differ, and every message fails to open. The protocol has no silent failure mode here — disagreement is fatal by construction.

3. The hybrid root key

K_root = HKDF-SHA256(
             IKM  = Z_X ‖ Z_PQ,          ← classical first, then post-quantum
             salt = th,
             info = "ATSAM/v1/pair-init" ‖ th,
             L    = 32 )

Why this is a genuine hybrid. Both secrets enter as a single input keying material. HKDF-Extract is a computational extractor over that concatenation, so if either half remains unknown to the adversary the extracted key — and therefore K_root — stays computationally indistinguishable from uniform. Formally:

Adv ≤ Adv_HKDF-PRG + min( Adv_X25519-DDH , Adv_ML-KEM-768-IND-CCA )

The min, rather than a sum, is what makes this a real hybrid. (The transcript hash in the salt slot provides binding, not secrecy — it is derived entirely from public values.) An attacker who breaks X25519 — including one holding a future quantum computer and a recording of today's traffic — still faces ML-KEM-768. An attacker who breaks ML-KEM still faces X25519. The construction degrades to the strength of the stronger surviving primitive, not the weaker one.

The transcript hash appears in both the salt and the info string. Either alone would bind the handshake; using both means a downgrade attempt has to defeat the extract stage and the expand stage.

4. The key tree

The root is never used directly. Each subsystem gets a labelled sub-key:

K_label = HKDF-SHA256( IKM = K_root , salt = ∅ , info = label , L = 32 )

Distinct labels — discovery, live confirmation, routing tags, message sealing — yield keys that are independent under the PRF assumption. Compromising a derived key does not reveal the root or any sibling key.

5. Sealing one message

seed  = HKDF-SHA256( K_root , info = "ATSAM/v1/msg-seal" )

K_msg = HKDF-SHA256(
            IKM  = seed,
            salt = "ATSAM/v1/msg-seal/salt",
            info = "ATSAM/v1/msg-seal" ‖ 0x00 ‖ sender ‖ 0x00 ‖ recipient ‖ 0x00 ‖ msgId,
            L    = 32 )

AAD   = SHA-256( "ATSAM/v1/msg-seal/aad" ‖ 0x00 ‖ version‖suite
                 ‖ 0x00 ‖ sender ‖ 0x00 ‖ recipient ‖ 0x00 ‖ msgId )

N     ←$ {0,1}⁹⁶
C ‖ τ = ChaCha20-Poly1305.Seal( K_msg , N , plaintext , AAD )     (RFC 8439)

Key separation per message. msgId is inside the info string, so every message derives a different K_msg. A nonce collision — catastrophic for ChaCha20-Poly1305 under a fixed key — would additionally require the same message identifier.

Directionality. sender and recipient occupy fixed ordered slots, so A→B and B→A derive different keys. A ciphertext reflected back at its author does not authenticate.

Injective encoding. Identifiers containing 0x00 are rejected before derivation, so the separator cannot be smuggled into a field to make two different triples produce identical info bytes.

Version binding. The version and cipher-suite bytes travel in clear on the wire and are bound into the AAD, so flipping them to steer a receiver onto a different suite invalidates the tag.

6. The safety number

The 30 digits you compare with a contact — six groups of five — are a deterministic function of K_root and the two identifiers in sorted order, so both sides compute the same string. Concretely: the root is passed through the key tree to its PV-Stealth lookup sub-key, that sub-key is hashed, the two sorted identifiers are appended, and the first 30 bytes of the SHA-512 digest are folded five at a time into six five-digit groups.

Because the identities are already bound into the transcript, a machine-in-the-middle who substituted a key produces a different root and therefore different digits. Comparing them out of band is what converts the protocol's mathematical guarantee into a guarantee about the human you meant to reach. Each group carries log₂(100000) ≈ 16.6 bits, so the comparison is worth roughly 100 bits against a second-preimage search — ample for an out-of-band check, and we quote that figure rather than the 240 bits of the underlying digest.

What this construction does not give you

A specification that only lists strengths is marketing, not cryptography. Three honest limits of the layer described above:

No forward secrecy in the message layer. K_msg is a deterministic function of a long-lived K_root and values that travel in clear. There is no ratchet. An adversary who later extracts K_root from a device can decrypt every archived message from that pair. Fresh per-message nonces do not provide forward secrecy, and we do not claim otherwise. Adding a ratchet to a delay-tolerant mesh — where messages legitimately arrive days late and out of order — requires a skipped-key window and an explicit epoch on the wire; it is scheduled work, not a shipped property.

Pairing must be completed deliberately. The guarantees above apply to a pair that has actually run the hybrid pairing exchange, which today means both people completing it from Settings → Security → Pair a device. Contacts you have not paired this way are protected by RAVEN's Noise-based layer instead — a different construction with different properties.

The post-quantum half can be absent. If either side lacks ML-KEM keys, pairing is refused by default. A caller may explicitly opt into an X25519-only mode in which Z_PQ is a fixed all-zero block; in that mode there is no post-quantum protection at all, and the root's security rests on X25519 alone.

Mathematics is not deployment. A correct construction can be let down by its implementation. RAVEN's security-critical source is published for exactly this reason, and findings sent to info@raven-messenger.com get an acknowledgement within 48 hours.

ATSAM Public Security Overview

Read the public overview of ATSAM, Raven's layered protocol for private discovery, encrypted mesh routing, and optional Vault Mode. The document covers design principles, the five-layer stack, the threat model, an design rationale, and a list of what ATSAM does not claim.

PDF · 15 pages · Raven Protocol Research · May 2026
Read the ATSAM Public Security Overview

What Raven protects against.

Different adversaries can do different things. The honest way to talk about security is to say who we defend against, and how.

Nearby radio observer

A stranger nearby may see Bluetooth or Wi-Fi traffic. Raven is designed so discovery beacons do not expose names, phone numbers, or stable public identities.

Replay attacker

An attacker may record an old beacon and replay it somewhere else. Raven uses live confirmation to prevent old discovery messages from being treated as verified presence.

Mesh relay

A relay may forward messages without being part of the conversation. Raven's mesh routing is designed so relays do not see plaintext content or stable recipient identifiers.

What Raven does not claim.

ATSAM is designed with honest security claims. It does not make Raven unbreakable, does not fully hide global traffic patterns, and cannot protect a device that is already compromised. Its goal is layered protection: strong content encryption, private peer discovery, safer mesh routing, and transparent limits.

The protocol on its own terms.

Raven is a different kind of system, and ATSAM is described on its own terms rather than measured against other products. The checklist below is what ATSAM aims to provide today, with clear limits stated alongside each item.

Capability
Raven with ATSAM
Works with internet
Yes
Works without internet (Bluetooth mesh)
Yes
End-to-end encrypted content
Yes
Private nearby discovery
Yes
Encrypted routing on every path (mesh + internet bridge)
Yes
Optional Vault Mode for sensitive text
Yes
Post-quantum hybrid pairing
Yes
Honest public security overview
Yes

Common questions.

Do I have to enable ATSAM manually?

Pairing is a deliberate step. Open Settings → Security → Pair a device, publish your bundle, enter your contact's user ID, and run the pair. Your contact accepts the pending request on their device, and you compare the 30-digit safety number out of band to confirm it.

Where can I verify ATSAM is on?

Open Raven → Settings → Security → ATSAM Protocol. The "ATSAM hybrid pairing" toggle is enabled. You will also see two optional content-layer add-ons (PROXIMA-VAULT and PV-Stealth) that ship off by default.

Can I turn ATSAM off?

There is a toggle in the ATSAM Protocol screen governing how new pairs are established. It does not remove protection from contacts you have already paired with. The toggle is there in case you ever want to interoperate with a peer running an older client.

Is Raven unbreakable?

No. No honest security system should claim that. Raven uses layered cryptography and states its limits clearly.

Is ATSAM the full protocol specification?

No. The public ATSAM document is a security overview. Internal specifications include wire formats, exact key schedules, and implementation requirements.

Does Raven work without internet?

Raven is designed to support offline communication through nearby-device mesh routing when internet connectivity is unavailable.

Does Vault Mode protect every message?

Vault Mode is optional and intended for high-sensitivity text or structured messages. Large media files use standard encrypted transport.

Does ATSAM hide all metadata?

ATSAM reduces identity and routing metadata exposure, but it does not fully hide timing, radio traffic volume, or global traffic patterns.

When does ATSAM ship inside Raven?

ATSAM is live as of Raven v2.0. The core pairing + key-tree layer is available and activates per paired contact; the two content-layer add-ons (PROXIMA-VAULT and PV-Stealth) ship off and stay opt-in per conversation.

Want the full public overview?

The complete ATSAM Public Security Overview includes the design principles, threat model, design rationale, a list of what ATSAM does not claim, and the development roadmap.

PDF · 15 pages · Raven Protocol Research · May 2026
Read the public overview