Feature/packet generation#32
Open
buckleypaul wants to merge 4 commits into
Open
Conversation
Add the ability to generate AES-CTR (v0) and AES-EAX (v2) Hubble BLE advertisement packets locally from a key and payload — the inverse of the existing decrypt path. Generated packets can optionally be posted to the Hubble Cloud or printed as raw bytes for matching against hardware emissions. SDK: - encrypt(key, payload, *, time_counter, seq_no, counter_mode) — AES-CTR - encrypt_eax(key, payload, *, counter, nonce_salt, period_exponent) — AES-EAX - Both return EncryptedPacket so org.ingest_packet works for either protocol. - _generate_ctr_eid helper mirrors firmware hubble_internal_device_id_get. - EAX EID derivation matches decrypt_eax exactly (key_0 from counter=0) to guarantee byte-for-byte round-trip even at high effective counters. CLI: hubblenetwork ble generate - Flags: --key, --payload(/format), --counter-mode, --counter, --seq-no, --nonce-salt, --period-exponent, --ingest, --format breakdown|hex|json - Dispatches by key length (32 → CTR, 16 → EAX) with mutually-exclusive flag validation per protocol. - Three output formats: structured breakdown (default), raw hex, and JSON. Tests: 44 new tests covering round-trip via decrypt/decrypt_eax, validation paths, header layout, EID embedding, format dispatch, and the --ingest path (with mocked Organization). Spec: docs/superpowers/specs/2026-04-30-packet-generation-design.md Plan: docs/superpowers/plans/2026-04-30-packet-generation.md
0e4b73c to
feb24f8
Compare
The b"int-uptime-" prefix (11 bytes) plus 4 random bytes produced a 15-byte payload, exceeding MAX_CTR_PAYLOAD. Shortened to b"int-up-".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.