feat: add GroupText 1/2-byte channel hash auto-detection#11
Open
Nivek-domo wants to merge 1 commit intomichaelhart:mainfrom
Open
feat: add GroupText 1/2-byte channel hash auto-detection#11Nivek-domo wants to merge 1 commit intomichaelhart:mainfrom
Nivek-domo wants to merge 1 commit intomichaelhart:mainfrom
Conversation
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.
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.