Use 11-character signatures and detect headers across WBR

This commit is contained in:
2026-09-17 22:10:12 -07:00
parent a312b1f58a
commit f8935c656c
24 changed files with 363 additions and 101 deletions

View File

@@ -15,6 +15,30 @@ Choosing the right ZWUS base depends on platform compatibility.
If you enable **Sign** when encoding, an invisible signature is attached to the secret message. When decoding—either in the extension popup or via the on-screen overlay—inØsight automatically identifies the base and cipher.
### Signature format
New signatures contain exactly **11 zero-width characters**:
`standard header (5) + unifier (1) + zero digit (1) + mode ID (4)`
The five-character standard headers are unchanged. The unifier and digits use the selected standard's alphabet. Mode IDs are encoded in that standard's base and padded to exactly four digits:
| Mode ID | Mode |
| :--- | :--- |
| `0000` | PLAIN |
| `0001` | SPECK48_96CTR |
| `0002` | SPECK32_64ECB (insecure) |
Detection requires an exact match to one of the nine registered signatures (three standards × three modes). Unknown IDs and partial headers are not modern signatures. Characters after a matched signature belong to the payload; they never extend the signature. PLAIN uses the same header format as the ciphers but does not encrypt the payload.
### Legacy signatures
For compatibility, inØsight still reads the old five-character PLAIN headers and ten-character encrypted headers for ZWUS-3, ZWUS-6, and ZWUS-7. New encoding always writes the 11-character format. Complete modern signatures take priority within an uninterrupted zero-width run. Legacy messages separated from modern messages by visible text remain independently detectable.
Legacy recognition is isolated in `LEGACY_SIGNATURES` and `parseLegacySig` in `sig.js`, with explicitly labeled legacy tests. To retire it, remove that registry, reader, legacy tests, and the `legacyPlain` condition in `findSig`, then make `parseSig` use only `parseModernSig`. Future standards must not be added to the legacy registry.
Incomplete or unknown extended headers do not fall back to legacy PLAIN. Exact legacy encrypted headers remain recognized, with everything after their tenth character treated as payload.
---
## Unicode Alphabet by Standard