Protect iOS app secrets by first sorting them, then giving each kind its own home. Values shipped in the app, such as API keys and endpoints, can be recovered by anyone patient enough to analyse the binary, so Otukan encodes the ones you keep and helps you move shared secrets to your server. Per-user credentials belong in the Keychain with the right accessibility class, and Otukan withholds the items you mark while the device or process looks compromised. Keys that sign or agree keys can live in the Secure Enclave. No app-side technique keeps an embedded secret hidden for good, so rotation and short-lived tokens finish the job.
The Android and cross-platform side of key handling is covered on mobile app secrets protection.
Hardcoded values versus user credentials
Most secret leaks start with putting a value in the wrong category. The table sets out the categories Otukan works with.
| Kind of value | Examples | Where it should live | What Otukan adds |
|---|---|---|---|
| Public identifier | Analytics or map SDK keys limited by bundle ID | In the app, rotatable | Discovery, so you know it is there |
| Shared app secret | Request-signing keys, partner API secrets | On your server, replaced by tokens | Encoding for any value that must stay for now |
| Per-user credential | Refresh tokens, session keys | Keychain, this-device-only where possible | Risk-gated reads and reinstall awareness |
| Device-bound private key | Keys that sign transactions or bind the device | Secure Enclave | Runtime signals before each signing request |
The rule of thumb: if every copy of the app holds the same value, assume it will be found. Otukan’s build report lists the values that look like credentials so your team can decide which ones to move.
Keychain and key-access responsibilities
What iOS gives you
The Keychain encrypts items at rest and ties them to your team through access groups, which is also how the app shares items with its extensions. Accessibility classes decide when an item can be read, for example only while the device is unlocked, and whether it may leave the device in a backup. Access control flags can require a passcode or current biometric enrolment, so an item stops opening when someone adds a new fingerprint or face.
What stays your responsibility
- Choose the accessibility class per item rather than one default for the app.
- Keep extensions in a shared access group only when they need the item.
- Encrypt large data with a symmetric key and protect that key, instead of storing bulk data as Keychain items.
- Treat the Secure Enclave as a place for signing and key-agreement keys, not general storage.
What Otukan adds
The Keychain assumes the app asking for an item is the genuine, unmodified one. On a jailbroken device with hooks in place, that assumption no longer holds. Otukan checks for those conditions before a marked item is read and pauses the read while they last. Data encryption practice is covered on iOS app data encryption.
Rotation, reinstall, backup and runtime limits
Rotation
Design every embedded value to be replaceable in the next release, and prefer credentials your server issues for minutes or hours. Paired with App Attest, your backend can hand those tokens only to a genuine copy of the app.
Reinstall and backup
Keychain items can survive app deletion, and items without the this-device-only suffix can reach a new phone through an encrypted backup. Otukan recognises a fresh install so your policy can clear or revalidate what it finds, and your team decides which items may travel.
Runtime limits
A secret has to exist in plain form while it is used. Otukan narrows that window by decoding values only when called and clearing them afterwards, and memory detail is covered on iOS app memory protection.
Testing the edge cases
Acceptance runs on physical devices with the distribution-signed build: attempt to read marked items under a lab jailbreak and hooks, repeat the flow on a clean device, then test reinstall, restore, migration to a new iPhone and a biometric change. Versions, results and the reviewer are recorded. Step-by-step iOS material is in iOS app security guides.
The rest of Otukan’s iOS protection is on iOS app security. The free App Exposure Check works from your public App Store release, and we never ask you for the secrets themselves.