chore: remove unused `Login._encrypted_qr_code` from `src/krux/pages/login.py` (#736)
What changed, and why it matters
This commit simply deletes an unused internal helper method called _encrypted_qr_code from the login page code. There is no functional change to the app, no bug fix, and no security-relevant behavior altered. It is routine code cleanup.
No security action needed. Treat as normal maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff removes the Login._encrypted_qr_code() method from src/krux/pages/login.py. The method handled decoding and decrypting encrypted QR codes, but it is no longer referenced anywhere in the codebase. No callers, tests, or related logic are modified. The change is purely dead-code elimination.
Changed components
src/krux/pages/login.pyInspect captured patch +0 / −38
diff --git a/src/krux/pages/login.py b/src/krux/pages/login.py
index e0dfde6..ac99206 100644
--- a/src/krux/pages/login.py
+++ b/src/krux/pages/login.py
@@ -219,7 +219,6 @@ class Login(Page):
# Checks if user wants to create a double mnemonic
if len_mnemonic == EXTRA_MNEMONIC_LENGTH_FLAG:
-
# import time # Debug
# pre_t = time.ticks_ms() # Debug
@@ -277,7 +276,6 @@ class Login(Page):
# Don't show word list confirmation or the mnemonic editor if hide mnemonic is enabled
if not Settings().security.hide_mnemonic:
-
if charset != LETTERS:
if self._confirm_key_from_digits(mnemonic, charset) is not None:
return MENU_CONTINUE
@@ -441,42 +439,6 @@ class Login(Page):
return None
- def _encrypted_qr_code(self, data):
- from ..encryption import EncryptedQRCode
- from ..baseconv import base_decode
-
- encrypted_qr = EncryptedQRCode()
- public_data = None
- try: # Try to decode base43 data
- data = base_decode(data, 43)
- public_data = encrypted_qr.public_data(data)
- except:
- pass
- if not public_data: # Failed to decode and parse base43
- public_data = encrypted_qr.public_data(data)
- if public_data:
- self.ctx.display.clear()
- if self.prompt(
- public_data + "\n\n" + t("Decrypt?"), self.ctx.display.height() // 2
- ):
- from .encryption_ui import EncryptionKey
- from embit.bip39 import mnemonic_from_bytes
-
- key_capture = EncryptionKey(self.ctx)
- key = key_capture.encryption_key()
- if key in (None, "", ESC_KEY):
- self.flash_error(t("Key was not provided"))
- return MENU_CONTINUE
- self.ctx.display.clear()
- self.ctx.display.draw_centered_text(t("Processing…"))
- word_bytes = encrypted_qr.decrypt(key)
- if word_bytes is None:
- self.flash_error(t("Failed to decrypt"))
- return MENU_CONTINUE
- return mnemonic_from_bytes(word_bytes).split()
- return MENU_CONTINUE # prompt NO
- return None
-
def auto_complete_qr_words(self, words):
"""Ensure all words are in the wordlist, autocomplete if possible"""
for i, word in enumerate(words):
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.