Skip to content

Enable ECDH encryption for T8214 and T8425 P2P sessions - #795

Merged
max246 merged 6 commits into
bropat:developfrom
lenoxys:fix/t8214-t8425-ecdh-encryption
May 22, 2026
Merged

Enable ECDH encryption for T8214 and T8425 P2P sessions#795
max246 merged 6 commits into
bropat:developfrom
lenoxys:fix/t8214-t8425-ecdh-encryption

Conversation

@lenoxys

@lenoxys lenoxys commented Feb 16, 2026

Copy link
Copy Markdown
Contributor

Enable ECDH encryption for T8214 and T8425 P2P sessions

Summary

T8214 (Battery Doorbell Plus E340) and T8425 (Floodlight Camera) use ECDH key exchange instead of RSA for P2P session encryption. This PR adds ECDH support, gated exclusively to these two devices.

Depends on #793 (device registration + livestream routing).

What was wrong

When the station sends CMD_GATEWAYINFO, T8214/T8425 provide an ECDH public key instead of RSA-encrypted data. The RSA decrypt fails and the session falls back to Level 1 encryption, breaking livestream.

What this PR does

  1. Adds ecc_private_key optional field to the Cipher API model.
  2. Adds decryptP2PKeyECDH function to derive the session key via ECDH shared secret.
  3. In CMD_GATEWAYINFO handling: tries RSA first, falls back to ECDH only if station_sn starts with T8214 or T8425 and ecc_private_key exists.
  4. Adds block-alignment guard — skips decryption when payload is not a multiple of 16 bytes (observed with 36-byte status replies from these devices).
  5. Unit tests for decryptP2PKeyECDH (6 tests, all passing).

Testing

  • ECDH key exchange tested end-to-end on T8214 and T8425.
  • 6 unit tests for decryptP2PKeyECDH covering compressed/uncompressed pubkeys, ECIES envelopes, determinism, and output size.

@max246

max246 commented Feb 28, 2026

Copy link
Copy Markdown
Collaborator

Might hold off on this one until we release tomorrow, so many things merged and I am running the develop for now to ensure it works

@lenoxys
lenoxys force-pushed the fix/t8214-t8425-ecdh-encryption branch 2 times, most recently from ff288ff to aaa18e9 Compare April 30, 2026 09:36
@lenoxys
lenoxys force-pushed the fix/t8214-t8425-ecdh-encryption branch from aaa18e9 to 0f8b8e3 Compare May 21, 2026 19:17
@max246
max246 merged commit dd94e70 into bropat:develop May 22, 2026
3 checks passed
@lenoxys
lenoxys deleted the fix/t8214-t8425-ecdh-encryption branch May 26, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Eufy E340 Dual Cam Doorbell live stream problem [Bug]: Old floodlight cam works, but E340 floodlight does not work (without HomeBase3)

2 participants