Android

Is DataStore a secure secrets vault?

Intents, storage, permissions, WebView and inter-app communication.

Android components1 min readEditorial methods

DataStore manages small application datasets. Convenient preference storage does not automatically make it suitable for tokens or cryptographic keys.

Evaluation approach

Separate preferences from secrets and include encryption and key management in the selected storage design.

Application example

A theme preference affects appearance; a refresh token can affect account access. They should not automatically share access and cleanup policies.

Limits and considerations

A modern API does not inherently provide encryption or hardware protection.

How to distinguish a preference from a secret

Assess whether disclosure merely changes presentation or grants account access or transaction authority. Check that helper layers do not copy secrets into logs or backups.

Checks and decisions

  • Classify data
  • Manage secrets separately
  • Verify logout cleanup

Sources

The primary references above provide the technical basis. Example workflows and evaluation suggestions are this publication’s explanations, not independent test results for a particular product.