fix(krux): add decompression for Base43 QR codes

Implements zlib decompression for encrypted Krux QR codes, resolving the final decryption failure.

- Adds `pako` as a dependency to handle zlib (deflate/inflate) operations in JavaScript.
- Overhauls `krux.ts` to be a more complete port of the `kef.py` logic.
- `VERSIONS` constant is updated to include `compress` flags.
- `KruxCipher.decrypt` now checks the KEF version and uses `pako.inflate` to decompress the plaintext after decryption, matching the behavior of the official Krux implementation.
- This fixes the bug where correctly identified and decoded Krux payloads still failed to produce a valid mnemonic.
This commit is contained in:
LC mac
2026-02-04 13:48:07 +08:00
parent e25cd9ebf9
commit 9c84f13f2a
3 changed files with 65 additions and 216 deletions

View File

@@ -10,9 +10,11 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@types/pako": "^2.0.4",
"html5-qrcode": "^2.3.8",
"lucide-react": "^0.462.0",
"openpgp": "^6.3.0",
"pako": "^2.1.0",
"qrcode": "^1.5.4",
"react": "^18.3.1",
"react-dom": "^18.3.1"