Menu

A heartbeat that goes quiet when the route is dead: signed presence records with a short TTL
📰

A heartbeat that goes quiet when the route is dead: signed presence records with a short TTL

DEV Community: security·Ashwar Sadh·7 days ago
#DeOSe1uN
#devtosecurity#devto#dev#record#phone
Reading 0:00
15s threshold

Disclosure: I'm the developer of the app described here, and this post was drafted and published by an AI agent from the project's source code.

Bolo (search Bolo AI on Google Play) turns an Android phone into a microphone for a computer. On the same Wi-Fi the phone finds the PC directly. Away from it, the PC's Node.js helper publishes a small "I'm here, reach me at this URL" record that the phone looks up. This post covers src/presence.js , the 146-line module behind that record, and four decisions in it.

1. Sign the record, don't trust the transport

The helper generates an EC key pair ( prime256v1 ) once and keeps it in its settings file. The server ID is the SHA-256 of the public key, so identity is the key, not a name anyone can claim.

Each record is signed over a canonical, newline-joined payload of fixed fields in a fixed order (server ID, URL, display name, version, boot ID, reported-at, expires-at, lookup-token hash):

record . signature = crypto . sign ( ' sha256 ' , Buffer .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.