-
Notifications
You must be signed in to change notification settings - Fork 2
Cryptographic Security and Provisioning
GiZano edited this page Aug 5, 2026
·
2 revisions
QuakeGuard implements a Zero-Trust security model for its IoT edge nodes.
Upon its first boot, the ESP32-C3 uses mbedtls to generate a unique ECDSA key pair using the NIST P-256 curve (secp256r1).
- Private Key: Stored permanently in Non-Volatile Storage (NVS) to sign outgoing telemetry.
- Public Key: Extracted in DER format, acting as the unforgeable cryptographic identity of the sensor.
- The device sends a
POSTto/devices/registerwith itspublic_key_hex, MAC address, coordinates, andENROLLMENT_TOKEN. - The backend validates the token and uses PostGIS (
ST_Contains) to assign the sensor to the smallest containing geographic polygon. - A unique
sensor_idis returned and saved to NVS.
Telemetry payloads (value:timestamp) are hashed via SHA-256 and signed with the private key. The validate_iot_payload dependency pipeline enforces:
-
API Key Verification: Constant-time
hmac.compare_digestcheck. - Sensor Status: Verifies the sensor ID is active.
- Anti-Replay Protection: Rejects payloads older than a 300-second threshold.
-
Signature Verification: Uses the Python
cryptographylibrary to verify the ECDSA signature against the device's public key.
- Previous: Hardware & Edge Computing (ESP32-C3)
- Next: Data Plane & Message Broker (MQTT)
- Back to: Home