Skip to main content

Camera (session) camera-session.1

A camera whose photos only one card can open. The card and the device agree on a new session key and use it for each photo.

← Device types

Use​

When one browser should see the photos, and a leaked E2E key on the device or browser must not open earlier photos.

On the device​

On connecting, the device announces this type with t= in @$ui and sends @$state whenever its state changes. Apps send commands to <cid>@.

@$name My Camera (session):Living room
@$ui t=camera-session.1
@$state on=1;interval=100

State keys @$state​

KeyValuesMeaning
on0 / 11 while sending photos, 0 when stopped
interval100 / 200 / 500 / 1000 / 2000 / 5000Interval between photos (ms)
session1 when a card receives photos, 0 when none (no photos are sent)

Commands <cid>@​

CommandMeaning
onStart sending
offStop sending
interval={v}Set the interval to {v} ms

{v} is the slider or color value. Even for an unknown command the device should send its current state, so the app does not wait.

Implementation notes​

  • Put the same E2E key in the device and the card. That key only proves each side; photos are encrypted with the session key (io.signal_e2e("@image", buf, len, sessionKey)). The device never sends plain photos.
  • The session key is agreed with X25519. The card sends <cid>@e2e-hello, the device answers <cid>@e2e-challenge (nonce), the card sends a hello with its public key and an HMAC (E2E key), and the device sends <cid>@e2e-ready with its public key and an HMAC. Both derive the same key with HKDF-SHA256; only public values cross the wire.
  • Each side keeps its secret in memory, uses it once and drops it, so learning the E2E key later does not open recorded photos.
  • One card at a time. Another card can take over with 'receive in this browser', and the earlier card can no longer open photos.
  • The session ends, and the card makes a new one, when the device restarts, the E2E key changes, or ten minutes pass.
  • Needs WebCrypto X25519 (recent Chrome, Edge, Firefox, Safari).
  • The anonymous connection limits and the interval advice are the same as camera.1.

Default picture​

This type has no default picture.

Examples​

Type file​

iosignal/devices/types/camera-session.1.json (rev 1) · CDN

The screen labels in the type file are in Korean; apps show them as written.