Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement PIN/passphrase generation UI #324

Open
wants to merge 2 commits into
base: 15
Choose a base branch
from

Conversation

inthewaves
Copy link
Member

@inthewaves inthewaves commented Jan 26, 2025

Closes GrapheneOS/os-issue-tracker#599

Passphrases have been implemented using EFF's Long Wordlist of $6^5$ words. In terms of entropy, an 8-word passphrase would have a search space of $(6^5)^8 \approx 2^{103}$. This wordlist can be easily changed; just make sure to update the various constants in the DicewareWordList class.

Test: Manual
Test: atest -c SettingsUnitTests:com.android.settings.password.generate (after building with m and running emulator)
Test: SetupWizard2:

adb shell pm enable app.grapheneos.setupwizard
adb shell settings put secure user_setup_complete 0
adb shell am start -a android.intent.action.MAIN -n app.grapheneos.setupwizard/app.grapheneos.setupwizard.view.activity.WelcomeActivity

@inthewaves inthewaves force-pushed the pin-passphrase-gen-2 branch 5 times, most recently from 1fc6572 to 425ecac Compare January 26, 2025 12:57
@thestinger thestinger force-pushed the 15 branch 2 times, most recently from 0cda973 to d3c03c8 Compare January 27, 2025 09:01
@inthewaves inthewaves force-pushed the pin-passphrase-gen-2 branch from 666c89e to 932b760 Compare January 28, 2025 06:34
@inthewaves
Copy link
Member Author

inthewaves commented Jan 28, 2025

Changes since rebase:

  • fix PasswordComplexity parsing & remove flaky test functions
  • allow skip and changing lock type from SetupWizard. I was reading a comment from BiometricUtil about how PIN is used by default, but I didn't realize it launched SetupLockPassword (via class function overrides) which has its own buttons for choosing lock and skipping. Should've compared it with the original SetupWizard flow
  • clarify comments & test password lengths and selections

@inthewaves inthewaves force-pushed the pin-passphrase-gen-2 branch 2 times, most recently from 382a87b to 1663717 Compare January 28, 2025 07:57
Passphrases have been implemented using EFF's Long Wordlist of 6^5
words. In terms of entropy, an 8-word passphrase would have a search
space of (6^5)^8 ~= 2^103. This wordlist can be easily changed; just
make sure to update the various constants in the DicewareWordList class

Test: Manual
Test: atest -c SettingsUnitTests:com.android.settings.password.generate
(after building with m and running emulator)
Test: SetupWizard2
@inthewaves inthewaves force-pushed the pin-passphrase-gen-2 branch from ec4a72d to cf957c9 Compare January 29, 2025 03:28
@inthewaves
Copy link
Member Author

inthewaves commented Jan 29, 2025

Changes since rebase:

  • hide auto-PIN in SetupWizard and other fixes (auto-PIN originally disabled in SetupWizard but generation flow didn't handle that until now; see 4c8ad8f)
  • make a copy of the credential in the save request for Fragment's SaveWorker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

provide a UI for generating random PIN/passphrases
1 participant