📚 Encyclopedia

Security & Cryptography · updated 2026-11-23

Storing saved passwords, cards and tokens in an Android app

androidkeystoreaes-gcmpasswordsautofillcredit-cardsbiometricclipboardtokens

An app that saves logins, payment cards or a service token for the user (here the Tokay browser's password manager, card and address autofill, and Kagi session token) should keep them encrypted at rest with a key that cannot leave the phone, and should treat the screen lock as a UI gate rather than as the encryption itself. This is the design Tokay settled on in 2026-10, and why.

Encryption at rest

The screen-lock gate

Offering a saved login without trapping the user

The browser engine asks the app for saved logins every time a login field gets focus. Answering with a modal dialog creates a loop: the dialog takes focus, closing it (by picking or canceling) hands focus back to the field, and the engine asks again. The user can neither use the saved login nor type one by hand. Card and address pickers had a "don't ask again on this page" guard; the login picker did not.

What not to store or leak

Importing from other password managers

CSV exports from Chrome, Firefox, Bitwarden and Safari differ in column names; map them and keep only http(s) origins (Chrome includes android:// app credentials, Firefox a Firefox-accounts row). A CSV export is a plaintext file of every password: tell the user to delete it after import.

Sync is a separate decision

Syncing saved passwords means either running a server that holds other people's (encrypted) credentials, or joining an existing end-to-end encrypted system such as Firefox Sync. For a personal app the recommendation was not to build sync at all; see the sync section of Building an Android browser on GeckoView (Tokay).

See also

Linked from

Sources: tokay memory (0.2.0, 0.3.7), tldr posts #1779, #1827, tokay memory (0.3.9, 0.3.10), tldr posts #1906, #1917