Skip to content

update livelog command with --key option, required for v4.12+ firmware#65

Open
chrismerck wants to merge 3 commits intotrunkfrom
merck/livelog-encryption
Open

update livelog command with --key option, required for v4.12+ firmware#65
chrismerck wants to merge 3 commits intotrunkfrom
merck/livelog-encryption

Conversation

@chrismerck
Copy link
Collaborator

Recent betas, and v4.12+ require livelog to be encrypted, so that it may be sent over the public internet. This implements the support for encrypted livelog in bond-cli.

@chrismerck
Copy link
Collaborator Author

with encryption:

image

when key not provided and fw is newer:

Exception: Encryption key is required by this Bond. Provide with --key option.

still supporting older fw without --key:

Screenshot 2025-01-23 at 3 42 26 PM

chrismerck and others added 2 commits January 30, 2026 12:37
Drop EOL Python 3.7/3.8 (removed from ubuntu-latest runners),
add 3.10–3.12. Bump actions/checkout to v4 and actions/setup-python
to v5. Fix missing blank line (E302) in livelog.py.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@chrismerck chrismerck force-pushed the merck/livelog-encryption branch from b7cb24e to d23527f Compare January 30, 2026 17:38
@chrismerck
Copy link
Collaborator Author

chrismerck commented Jan 30, 2026

CodeQL: AES-ECB mode alert (accepted risk)

The CodeQL check flags AES.new(aes_key, AES.MODE_ECB) as a high-severity finding. This is an accepted risk given our security model.

Why ECB is used: The firmware (BDebug_Livelog.c) encrypts log lines using AES-128-ECB via mbedtls. The bond-cli decryptor must match the firmware's cipher mode — there is no mode negotiation.

The vulnerability: ECB encrypts each 16-byte block independently and deterministically. Identical plaintext blocks produce identical ciphertext, leaking repetition patterns to an observer (the "ECB penguin" problem).

Why it's acceptable here:

  • Livelog is a short-lived developer debug session, not a persistent data channel
  • The encrypted content is ephemeral log text with high entropy (timestamps, addresses, counters)

CBC would be strictly better at negligible cost (+16 bytes IV per packet, ~0 CPU difference on ESP32 hardware AES), but that requires a coordinated firmware change and is out of scope for this PR.

— Claude

User prompt: "livelog --key, if not provided, use random value"

When --key is omitted, generate a random 16-character alphanumeric
key instead of passing None. This ensures encryption is always
active in listen mode, which is required for v4.13+ firmware.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants