android-security-encryptionlisted
Install: claude install-skill lenorebreakneck630/claude-zero-to-hero-android-KMP
# Android Security and Encryption
## Core Principles
- Encrypt sensitive local data only when the threat model justifies it.
- Keep secrets out of source control and out of logs.
- Minimize what is stored locally in the first place.
- Prefer platform-backed security primitives over custom crypto.
- Security decisions should be explicit and documented, not accidental.
---
## What Usually Needs Protection
Typical sensitive data:
- auth/session secrets
- refresh tokens
- locally cached private user data when risk is meaningful
- API credentials used only for local dev tooling, not production runtime
- cryptographic keys and encrypted file metadata
Usually not worth heavy encryption by itself:
- theme settings
- sort order
- onboarding flags
- non-sensitive feature toggles
See the **android-datastore-preferences** and **android-auth-security** skills for adjacent storage guidance.
---
## Use Platform Security First
Prefer:
- Android Keystore for key management
- platform biometric/device credential prompts for local unlock
- vetted libraries/APIs for encrypted storage
Avoid:
- inventing custom encryption schemes
- hardcoding keys in app code
- storing raw secrets unencrypted in SharedPreferences or plain files
---
## Keystore Boundary
The Keystore should manage keys, not your whole app architecture.
Good pattern:
- generate/store a key alias in Keystore
- use it to wrap or protect local sensitive values
- keep higher-level repositories unaware of crypto details whe