# Desktop and Mobile Client Security Apply these rules to desktop and mobile client apps, such as WPF, WinUI, .NET MAUI, Electron, or native iOS and Android apps. * Treat the shipped app as public: binaries, resources, and configuration can be inspected, decompiled, and modified. Never embed server secrets, API keys with privileged scope, signing keys, or connection strings; call a backend that holds them. * Never rely on client-side checks for authorization, licensing, or pricing. Enforce every decision on the server. * Store user secrets and tokens only in the platform's protected store: DPAPI or Windows Credential Manager on Windows, Keychain on Apple platforms, and Keystore-backed storage on Android. Never use plain files, settings, preferences, or the registry for them. * Protect local data at rest in proportion to its sensitivity, keep caches and logs free of secrets, and clear sensitive data on sign-out. * Validate everything received from the server, local files, IPC, deep links, custom URL schemes, and other apps as untrusted input. * Use TLS with full certificate validation. Add certificate pinning only with a tested rotation plan, because a stale pin locks users out. * Deliver updates through signed packages from trusted channels, and verify signatures before installing. Sign your own binaries and installers. * Request only the platform permissions the app needs, at the point of use. * Keep WebView content restricted to trusted origins, disable JavaScript bridges for untrusted content, and treat web content loaded into the app as untrusted.