Guide

Memory protection solution guide

How to evaluate mobile app memory protection: find exposed values, map their plaintext lifetime and validate protection apart from storage encryption.

  • Name the values

    Tokens, keys, card numbers and balances face different risks. List each value and whether reading or altering it is the threat.

  • Shrink the plaintext window

    Every value is readable at some point. Map when it appears, who copies it and when it is cleared.

  • Test the running app

    Encryption at rest says nothing about a live process. Validate memory protection with an authorised test on your own build.

Evaluate memory protection by following one sensitive value through its whole life in your app, whether a session token, a card number, a decryption key or an account balance, and asking where it can be read or changed while the app runs. Check three things: exactly which values and buffers are exposed, how long each stays in plaintext and where plaintext cannot be avoided, and how protection is validated without mistaking storage encryption for it. This applies to Android and iOS apps, each scoped separately. Otukan guards sensitive values at runtime and detects the tools attackers use to read or rewrite memory.

The control itself is covered on mobile app memory protection.

Exposure

Memory attacks are specific. Nobody steals “memory”; they lift one token or change one number. Start with the list.

Values worth protecting

  • Which secrets pass through memory: access and refresh tokens, cryptographic keys, one-time codes, card and account numbers?
  • Which values cause harm if altered rather than read: balances, transfer limits, entitlement flags, prices?
  • Which buffers carry them: network responses, parsed JSON, text fields, camera frames of identity documents?

Routes into the process

  • Does the solution notice a debugger attached to the running app?
  • Does it detect instrumentation frameworks that read values as they are decrypted?
  • Does it recognise emulators, where an attacker can dump process memory at will?
  • How does it treat rooted Android and jailbroken iOS devices, where other processes gain wider access?
ValueMain threatExample consequence
Refresh tokenReadSession replayed from another device
Encryption keyReadStored data decrypted offline
Transfer limitAlteredChecks in the app bypassed before the server sees the request
One-time codeReadSecond factor used by someone else

How Otukan answers. Otukan detects debuggers, instrumentation frameworks and emulators while your app runs, and it reacts when code is injected into the process. Sensitive values you select receive memory protection, so they are harder to locate and harder to change in place.

Lifetime

Every value is readable at some moment. The aim is to make that moment short, known and watched.

Sensitive-value lifecycle

StageQuestion to answerAndroid noteiOS note
CreationWhere does the value first appear in plaintext?Kotlin and Java strings are immutable and cannot be wiped; prefer byte or char arraysSwift strings can be copied by the runtime; prefer buffers you control
UseWhich components receive a copy?Libraries, logging and UI bindings may keep their ownSame concern for frameworks and view models
Clean-upIs the buffer overwritten after use?Arrays can be zeroed; garbage collection timing is outside your controlBuffers you allocate can be zeroed before release
Accepted boundaryWhere must it stay readable?Text on screen, the TLS layerText on screen, the TLS layer

Keep keys out of the app

  • Is key material held in the Android Keystore, or in the iOS Keychain and Secure Enclave, wherever the operation allows, so the app never holds it in plain form?
  • Are decrypted values released the moment the operation completes?
  • Are sensitive values excluded from logs, crash reports and analytics?
  • Is the accepted plaintext window written down for each value, with an owner?

How Otukan answers. Otukan keeps protected values encrypted in memory between uses, holds them in clearable buffers rather than immutable types where the platform allows, and wipes key material straight after each cryptographic operation. We document the plaintext boundary for each sensitive value together with your engineers. Where a value must be readable, such as text shown on screen, it is recorded as an accepted boundary and covered by runtime detection of the tools that would read it.

Validation

Storage encryption protects data at rest. It says nothing about what can be read from a live process, so test memory protection on its own terms.

Authorised memory test

  • Plant a known test value in your own build and search process memory for it, with and without protection, on a device you control.
  • Try to change a protected value while the app runs and record whether the app notices and how it responds.
  • Repeat on Android and on iOS, and keep the results apart.

Legitimate runtime baseline

  • Confirm crash reporting, accessibility services and performance tools keep working with protection switched on.
  • Measure start-up time and your most sensitive flows on devices you choose.
  • Record which response each detection triggers, and check it matches the flow.

How Otukan answers. Otukan supports an authorised memory test in your own lab with test values, so your engineers see the difference directly. When tampering with a protected value is detected, the app applies the response you chose for that flow, from observing quietly to ending the session, and your backend receives the memory-access signal with the next request.

Related runtime controls are covered on hooking detection and anti-debugging. Inventorying what the app carries and assigning the key lifecycle are covered on the secrets and key protection solution guide.

Common questions

  • Is storage encryption enough to protect values in memory?

    No. Storage encryption protects data at rest and says nothing about what can be read from a live process. Memory protection is a separate control, so validate it on its own terms with an authorised memory test on your own build, keeping Android and iOS results apart.

  • How does Otukan protect sensitive values while the app runs?

    Otukan applies memory protection to the sensitive values you select, so they are harder to locate and harder to change in place. Protected values stay encrypted in memory between uses and sit in clearable buffers rather than immutable types where the platform allows. Key material is wiped straight after each cryptographic operation.

  • Can a value be hidden in memory at all times?

    No. Every value is readable at some moment, so the aim is to make that moment short, known and watched. Where a value must stay readable, such as text shown on screen, Otukan records it with your engineers as an accepted boundary and covers it with runtime detection of the tools that would read it.

  • What happens when someone tries to change a protected value?

    Otukan detects the attempt, and the app applies the response you chose for that flow, from observing quietly to ending the session. Your backend receives the memory-access signal with the next request, so the event is visible on your side as well as in the app.

  • Which attacker tools does memory protection look for?

    Otukan detects debuggers, instrumentation frameworks and emulators while your app runs, and it reacts when code is injected into the app process. These are the routes an attacker uses to read values as they are decrypted or to dump process memory.

Keep secrets short-lived and guarded

Tell us the platforms, the framework and the sensitive values your app handles at runtime. We never ask for real tokens, keys, customer data or your source code.

Or request a technical demo