mirror of
https://github.com/kccleoc/seedpgp-web.git
synced 2026-03-07 09:57:50 +08:00
fix(krux): add Base43 decoding for encrypted QR codes
Implements support for Base43-encoded QR codes generated by Krux devices, resolving a bug where they were misidentified as invalid text. - Adds a new `lib/base43.ts` module with a decoder ported from the official Krux Python implementation. - Updates `detectEncryptionMode` to use the Base43 alphabet for more accurate `'krux'` format detection. - Modifies `decryptFromKrux` to be robust, attempting to decode input as Hex first and falling back to Base43. - This allows the Seed Blender to correctly parse and trigger the decryption flow for both Hex and Base43-encoded Krux QR codes.
This commit is contained in:
@@ -174,7 +174,7 @@ export function SeedBlender({ onDirtyStateChange, setMnemonicForBackup, requestT
|
||||
try {
|
||||
let mnemonic: string;
|
||||
if (entry.inputType === 'krux') {
|
||||
mnemonic = (await decryptFromKrux({ kefHex: entry.rawInput, passphrase: entry.passwordInput })).mnemonic;
|
||||
mnemonic = (await decryptFromKrux({ kefData: entry.rawInput, passphrase: entry.passwordInput })).mnemonic;
|
||||
} else { // seedpgp
|
||||
mnemonic = (await decryptFromSeed({ frameText: entry.rawInput, messagePassword: entry.passwordInput, mode: 'pgp' })).w;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user