Skip to content

Commit c6aa1ea

Browse files
gcmsgclaude
andcommitted
docs: update security model for encrypt-then-sign (H-07)
- Send() description: "encrypt and sign" instead of "signed and encrypted" - Layer 2: signature covers full envelope including ciphertext - Layer 3: add encrypt-then-sign ordering note Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c6df642 commit c6aa1ea

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ for _, r := range results {
113113
| `agent.New(opts)` | Create a new Agent instance |
114114
| `agent.Start(ctx)` | Register with the platform and start accepting connections |
115115
| `agent.Stop(ctx)` | Unregister and close all connections |
116-
| `agent.Send(ctx, env)` | Send a signed and encrypted message to a peer |
116+
| `agent.Send(ctx, env)` | Encrypt and sign an envelope, then send to a peer |
117117
| `agent.OnMessage(handler)` | Register a message handler callback |
118118
| `agent.Discover(ctx, caps)` | Discover Agents by capabilities |
119119
| `agent.EstablishSession(peerID, peerX25519)` | Establish an E2E encrypted session |
@@ -150,11 +150,11 @@ On first connection, the peer's public key fingerprint is recorded in the local
150150

151151
### 2. Message Level — Ed25519 Signing
152152

153-
Every message is signed with the sender's private key. The receiver verifies the signature using the sender's public key, ensuring the message has not been tampered with and its origin is authentic.
153+
Every message is signed with the sender's private key. The signature covers the full envelope (headers + payload). For encrypted messages, the signature covers the ciphertext (encrypt-then-sign), enabling the receiver to verify sender identity before performing decryption.
154154

155155
### 3. Transport Level — End-to-End Encryption
156156

157-
X25519 public keys are exchanged during the signaling handshake. A shared secret is derived via ECDH and used with XChaCha20-Poly1305 to encrypt message payloads. Nostr transport additionally wraps messages in NIP-44 format.
157+
X25519 public keys are exchanged during the signaling handshake. A shared secret is derived via ECDH and used with XChaCha20-Poly1305 to encrypt message payloads. The encrypt-then-sign pattern prevents decryption-oracle attacks by allowing pre-authentication. Nostr transport additionally wraps messages in NIP-44 format.
158158

159159
### 4. Execution Level — Sandboxing
160160

0 commit comments

Comments
 (0)