Files
tai/taicpp/tests/whatsapp_data/session_ab.json
T
retoorandClaude Opus 4.8 115e403e67 whatsapp: native C++ client + terminal-screenshot tool
Native WhatsApp Web multi-device client in C++ (src/whatsapp/, namespace
detz::wa), built on OpenSSL plus a vendored public-domain ed25519 ref10
(third_party/ed25519, zlib) for XEdDSA and the nayuki QR generator
(third_party/qrcodegen, MIT); no new runtime dependency.

- WaCrypto, WaBinary, WaProto, WaNoise, WaSignal, WaDevice, WaSocket,
  WaClient, WaStore, WaQr, WaWizard.
- Verified offline against golden vectors captured from the real Baileys
  client (tests/whatsapp_data, from jfelipesjc/wa-go, MIT): HKDF/PBKDF2 RFC
  vectors, XEdDSA roundtrips, codec battery 19/19, ClientPayload byte-exact,
  the Noise handshake, and a 4-exchange Signal session byte-exact. Unit test
  build/whatsapp_test (16/16), run_all step whatsapp.unit.
- Verified live against web.whatsapp.com: `detz --whatsapp-link` connects,
  completes the Noise handshake, receives pair-device, renders a scannable QR
  in the terminal, and persists the device to the vault (whatsapp/<profile>.db).
  Also --whatsapp-status / --whatsapp-unlink.
- Agent tools whatsapp_send and whatsapp_contacts (detz-only, in DetzTools).
- Pairing completion after the phone scans, and the message send path
  (usync + prekey fetch + Signal encrypt + send node), are ported faithfully
  from whatsmeow but unverified in-tree (no linked account in development).
  send_image and own-device fan-out are not wired yet. See docs/whatsapp.md.

Also in this snapshot: the terminal-screenshot tool (src/termshot/,
terminal_screenshot, docs/termshot.md, research/terminal-screenshot-rendering)
and a concurrent session's in-progress llm/muse failover changes carried along
in the shared files.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-27 18:22:24 +01:00

120 lines
4.6 KiB
JSON

{
"_meta": {
"lib": "libsignal",
"libVersion": "6.0.0",
"note": "Golden Signal vectors from Baileys libsignal (WhiskeySockets/libsignal-node v6).",
"pubkeyFormat": "0x05-prefixed, 33 bytes (priv keys are 32 bytes raw)",
"versionByte": "0x33 = (3<<4)|3 for v3; first byte of every ciphertext",
"macTrailer": "last 8 bytes = HMAC-SHA256(macKey, version||serialized)[:8]",
"privateKeysNote": "alice.baseKey.priv + ephemeralsGenerated[] captured via runtime hook on curve.generateKeyPair (no on-disk patch). ephemeralsGenerated is in generation order; index 0 = alice X3DH baseKey; match each to a type-1 msg by the pub appearing as WhisperMessage.ephemeralKey (ratchet key).",
"protoFields": {
"WhisperMessage": {
"ephemeralKey": 1,
"counter": 2,
"previousCounter": 3,
"ciphertext": 4
},
"PreKeyWhisperMessage": {
"preKeyId": 1,
"baseKey": 2,
"identityKey": 3,
"message": 4,
"registrationId": 5,
"signedPreKeyId": 6
}
}
},
"bob": {
"identityKeyPair": {
"priv": "b01cf18616de3465f7bf0c35d1aa9ce2cb9ee789a18ebd21835ac5f52c9f4871",
"pub": "058145e775548a99bcd83f9762f142e18c75f140d29a78eb06855c66f3d0c4a628"
},
"registrationId": 229,
"signedPreKey": {
"id": 1,
"keyPair": {
"priv": "c007e4ea5647ae8742112de44e1b932c97ab8dbfbdaf53b671a29307e471d260",
"pub": "057e5a8733d90d474011dd6729f0b9ec79a5b857bd2484573c39de47a3ebae6626"
},
"signature": "40ca5537630abd0f9beaf9d19972b04a6965593efff0e7d405f9d5e9fb144977fc245a9330c2c7cb8ae397d0c3c41d30a5ffb9bf9b10d5479e3eae4dec84c781"
},
"preKey": {
"id": 31337,
"keyPair": {
"priv": "380f8a6897b6988a512103839c5706c29267b8a8197c819e6f154fb4aac2634e",
"pub": "0515f7045f70040d3843e81f85fcb3c4c73e25530fe8ce2849842cefb3f3711358"
}
}
},
"alice": {
"identityKeyPair": {
"priv": "507a73dd453888aa35927e388dc7b01e75e3592c9dc95eb1e25eadfaa1121577",
"pub": "057734c1731899d34408dbafd2f69ce9e71c37179ddcb4056dcaff9e8a70355f10"
},
"registrationId": 117,
"baseKey": {
"priv": "30dfb094961cae4131cb02f21201abc045b73cd5fce183a21c1680c92e364a6a",
"pub": "053067086fca49c23215ed0072f9519f498a143e757b85ec3956b923df9232a327"
}
},
"ephemeralsGenerated": [
{
"priv": "30dfb094961cae4131cb02f21201abc045b73cd5fce183a21c1680c92e364a6a",
"pub": "053067086fca49c23215ed0072f9519f498a143e757b85ec3956b923df9232a327"
},
{
"priv": "b8f725339b890331bb7b8af495ff3789e449b497c53f1f7fcdad330b09def044",
"pub": "05fcf4cbd0550b6db39cd353a80ead18582140ddce02b2d947ad33cae9f7631825"
},
{
"priv": "f801076c5aeb5921d5a41e5175e592ad73d592781e8e3e11cfe55ee375479267",
"pub": "055f366c2db4e44e33ee3eef0d7c4589734b1536d3ba6f2baf2bd74909a3ba8712"
},
{
"priv": "909d6cb7cc2b3c4ae771833d9c593a391e4fb295fd2a1183be1430bbe3416c46",
"pub": "0514a2d223f6a4dad317a830ad6d6e9d59cc3ea5737179fbccd3ea495a7c73ce03"
},
{
"priv": "207634bea326276723a7e41cd451165f7d327e355d3d3b67c81ab139deb82d4b",
"pub": "0510aa5d286ad9789928d1eef1c513abcee659d3b3a97f1e84345faf51383a937e"
}
],
"exchanges": [
{
"n": 1,
"dir": "a->b",
"type": "pkmsg",
"sigType": 3,
"ciphertextHex": "3308e9f4011221053067086fca49c23215ed0072f9519f498a143e757b85ec3956b923df9232a3271a21057734c1731899d34408dbafd2f69ce9e71c37179ddcb4056dcaff9e8a70355f102242330a2105fcf4cbd0550b6db39cd353a80ead18582140ddce02b2d947ad33cae9f7631825100018002210763bbb51fbb5bd1413165517ca21cc20558abe8b0a340f6128753001",
"plaintextHex": "6f6c6120626f622031",
"plaintext": "ola bob 1"
},
{
"n": 2,
"dir": "b->a",
"type": "msg",
"sigType": 1,
"ciphertextHex": "330a21055f366c2db4e44e33ee3eef0d7c4589734b1536d3ba6f2baf2bd74909a3ba8712100018002210c6166a2533ee88d074cf2aced7d199237f48f54963dcc97b",
"plaintextHex": "6f6920616c6963652032",
"plaintext": "oi alice 2"
},
{
"n": 3,
"dir": "a->b",
"type": "msg",
"sigType": 1,
"ciphertextHex": "330a210514a2d223f6a4dad317a830ad6d6e9d59cc3ea5737179fbccd3ea495a7c73ce03100018002210b5003ff4e1a7b384cf2e4fb8cae6040c7e352d271c9da3b0",
"plaintextHex": "6f6c6120626f622033",
"plaintext": "ola bob 3"
},
{
"n": 4,
"dir": "a->b",
"type": "msg",
"sigType": 1,
"ciphertextHex": "330a210514a2d223f6a4dad317a830ad6d6e9d59cc3ea5737179fbccd3ea495a7c73ce031001180022100d9867d62c85219a9db34b66017d47d853df2dd14c3b5bc6",
"plaintextHex": "6f6c6120626f622034",
"plaintext": "ola bob 4"
}
]
}