Skip to content

feat: add GroupText 1/2-byte channel hash auto-detection#11

Open
Nivek-domo wants to merge 1 commit intomichaelhart:mainfrom
Nivek-domo:feature/grouptext-2byte-hash-auto
Open

feat: add GroupText 1/2-byte channel hash auto-detection#11
Nivek-domo wants to merge 1 commit intomichaelhart:mainfrom
Nivek-domo:feature/grouptext-2byte-hash-auto

Conversation

@Nivek-domo
Copy link
Copy Markdown

This PR adds backward-compatible GroupText decryption support for both 1-byte and 2-byte channel hash formats.

Why:
The community is progressively moving from 1-byte to 2-byte channel hash prefixes to reduce collisions as channel count grows.

What changed:

Added decryption option groupTextChannelHashBytes with modes auto | 1 | 2.
Extended channel hash calculation to support variable hash-byte length.
Updated key store indexing to support both 1-byte and 2-byte channel hash lookups.
Reworked GroupText payload parsing to build candidates for both formats.
In auto mode, decoder tries both candidate layouts and selects the first valid MAC+decrypt result.
Added CLI option --group-hash-bytes .
Updated README with usage examples.
Added tests for:
Auto-detect with 2-byte GroupText channel hash
Forced 2-byte GroupText decryption mode
Compatibility:

Default behavior remains backward compatible.
Existing 1-byte GroupText packets continue to decode as before.
Validation:

Local test run: grouptext-decryption.test.ts -> 11/11 passed.
Verified decoding behavior on Raspberry Pi 3 environment as well.

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.

2 participants