{
  "id": 20332039,
  "title": "Where to store private keys in your app",
  "url": "https://urgent.news/2026/11/16/where-to-store-private-keys-in-your-app",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-16T21:21:40.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/litprotocol/where-to-store-private-keys-in-your-app-14fo"
  },
  "original_language": "en",
  "account": "Private keys should be stored securely in your application to prevent unauthorized access. The best storage options include app-specific secure hardware, like the iOS Keychain or Android Keystore on phones, and key management services, hardware security modules, or hosted signers on servers.\n\nFor a crypto wallet controlled by your app, consider using Lit Protocol, which keeps the key in a secure enclave and runs signing rules within the same enclave. Your server should hold an API key to request signatures, with no access to the actual private key.\n\nNever store private keys in source code, even in private repositories, as Git history retains them. Avoid placing keys in frontend bundles or browser storage, as they can be easily accessed. Environment variables offer better security but still pose risks, such as being baked into container images, appearing in crash reports, and being read by other processes.\n\nWhen a key must be in memory, store it in a secrets manager and load it when the process starts. Run signing code in a separate service to prevent the key from lingering in memory. Use a small balance for the wallet and replenish it from a separate offline wallet. Always have a plan for rotating keys before it becomes necessary.",
  "summary": "The safest place for a private key is somewhere your app can ask for a signature without ever reading the key. On a phone, that means the iOS Keychain or the Android Keystore. On a server, it means a key management service, a hardware security module, or a hosted signer. For a crypto wallet that your app controls, Lit Protocol keeps the key inside a secure enclave and runs your signing rule in…",
  "key_points": [
    "Store private keys in app-specific secure hardware like iOS Keychain or Android Keystore.",
    "Never store keys in source code, frontend bundles, browser storage, or environment variables."
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}