Offer to shuffle the digits of the PIN keypad - #7564
Open
hayaksi1 wants to merge 2 commits into
Open
Conversation
The PIN keypad always draws 1 to 0 in the same nine positions, so anyone watching the movement of a finger can read the PIN back without seeing the screen. A new switch under Screen lock draws the digits in a random order instead, keeping the same grid so the pad still looks and behaves the way it did. The order is drawn once per unlock screen rather than after every key, so a PIN can still be entered without hunting for each digit twice. The setting is off by default and lives next to the biometric unlock switch, in the same store. Part of element-hq#6031
Contributor
|
Thank you for your contribution! Here are a few things to check in the PR to ensure it's reviewed as quickly as possible:
|
bmarty
reviewed
Aug 26, 2026
bmarty
left a comment
Member
There was a problem hiding this comment.
Nice. We will need a product validation first.
Also, the current layout with the 0 at the bottom is quite a standard digit-keypad, but with a random number at this position, this could look weird...
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.
Content
The PIN keypad always draws 1 to 0 in the same nine positions, so anyone standing close enough to watch the movement of a finger can read the PIN back without seeing the screen at all. A new switch under Screen lock draws the digits in a random order instead, keeping the same grid so the pad still looks and behaves the way it did.
The order is drawn once per unlock screen rather than after every key, so a PIN can still be entered without hunting for each digit twice. The setting is off by default and lives next to the biometric unlock switch, in the same store.
Motivation and context
Relates to #6031.
Tests
PinKeypadTest— a shuffled keypad still offers every digit exactly once, and clicking a digit still emits that digit rather than the one that used to sit in that position.These do not assert that a shuffled pad differs from an unshuffled one, which is not deterministic; they assert that shuffling never loses, duplicates or mislabels a key.
Tested devices
Checklist