Join our Newsletter — 33% off our NHI Course
Home› Glossary› Architecture & Implementation› Credential Encrypted (CE) Storage
Architecture & Implementation

Credential Encrypted (CE) Storage

← Back to Glossary
By NHI Mgmt Group Updated November 26, 2026 Domain: Architecture & Implementation

Credential Encrypted (CE) Storage is the Android storage area whose encryption keys are protected by the user's lock screen credential, so its contents are unavailable until the user first unlocks the device after boot. Apps should keep tokens and secrets here rather than in device encrypted storage, which is readable before unlock.

What Credential Encrypted Storage Does

Credential Encrypted storage is Android’s protected storage area for data that should stay inaccessible until the user has unlocked the device after boot. It is designed for material that must not be readable in the pre-unlock state, especially application tokens, session material, and other secrets that should not sit in device-encrypted storage.

Why CE Storage Exists in Android’s Boot and Unlock Model

Android separates storage availability by unlock state because a phone can be powered on, physically seized, or rebooted long before the owner unlocks it. CE storage gives developers a way to align sensitive data with the user’s credential rather than with the simpler boot-time availability of the device. That distinction matters for apps that handle authentication material, where early availability would create avoidable exposure.

For practical decision-making, CE storage is the safer default for anything that should not be available to background processes, boot receivers, or a thief with only physical access to the powered-on device. Environment Variables vs Secrets Manager is useful adjacent reading because the same design principle applies: keep secrets out of broadly accessible locations.

What Breaks When Sensitive Material Is Placed Elsewhere

If tokens or secrets are written to storage that is readable before unlock, the app can unintentionally widen the attack window around reboot, loss, or device inspection. That is not just a confidentiality issue. It can also let an attacker reuse cached credentials, resume sessions, or impersonate the app after the user believed the device was still protected.

CE storage does not make secrets invulnerable, but it does narrow the period during which they are exposed and forces the attacker to obtain the user’s unlock credential state before reading the data. In Android security terms, that is materially different from keeping the same values in device-encrypted storage, which is intentionally available earlier in the boot sequence.

Where a stronger implementation pattern is needed, API Key Management Guide reinforces the lifecycle point that secrets should be scoped, rotated, and revoked rather than left in durable storage.

How to Think About CE Storage in Application Design

CE storage is best understood as a boundary around post-unlock trust. It is not a substitute for minimizing what the app stores, but it is the correct place for material that only becomes useful after the legitimate user has authenticated to the device. Apps that rely on persistent sign-in, offline access, or locally cached bearer material should treat CE storage as the default for those values.

That design choice also supports better incident response. If a device is lost while still locked after reboot, the most sensitive local data remains unavailable until unlock, which reduces the immediate value of the theft. If the device is later unlocked by an attacker or the user is tricked into doing so, the protection boundary changes and the app must still assume those secrets may need to be refreshed or revoked.

For broader secret-handling patterns, Secrets Management Guide is the best companion reference because it connects local storage choices to rotation, centralization, and secretless design.

Choosing CE Storage Versus Other Android Storage Choices

The main trade-off is availability versus protection. Device-encrypted storage is useful for data that must exist before first unlock, but it should not hold high-value authentication material unless there is a clear reason and a compensating control. CE storage is the right fit when confidentiality before first unlock matters more than immediate boot-time access.

In practice, that means developers should place refresh tokens, API keys, and similar sensitive state in CE storage unless an application requirement genuinely depends on pre-unlock access. For the surrounding control model, OWASP Non-Human Identity Top 10 provides useful context on why long-lived credentials and overexposed secrets create recurring risk across software systems.

Risk and Threat Considerations

CE storage reduces exposure, but it does not eliminate it. The main risk is storing tokens or other secrets somewhere else on the device, where they can be read before unlock, copied during compromise, or reused after physical loss. The protection is only as strong as the app’s discipline about where sensitive material is written.

Failure mechanism: An app caches credentials in device-encrypted storage, logs, backups, or another pre-unlock location, allowing a local attacker or post-boot malware to recover and reuse them without waiting for the user’s credential state.

Impact: Session theft, token replay, unauthorized API access, and broader account compromise can follow, especially when the stored material is a bearer token or long-lived secret.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Non-Human Identity Top 10 addresses the attack and risk surface, while NIST SP 800-53 Rev 5, CIS Controls v8 and OWASP ASVS set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Non-Human Identity Top 10NHI-02 — Secret LeakageCE storage protects secrets from pre-unlock exposure on devices.
NHI-07 — Long-Lived SecretsCE storage is relevant when bearer material must not persist broadly.
Recommendation — Store secrets in post-unlock storage and avoid readable pre-unlock locations. Prefer short-lived credentials and rotate material that must remain locally stored.
NIST SP 800-53 Rev 5IA-5 — Authenticator ManagementThe term concerns storage of authentication material and its lifecycle.
SC-28 — Protection of Information at RestCE storage is a mechanism for protecting sensitive data at rest before unlock.
Recommendation — Manage credential storage, rotation, and revocation for locally held authenticators. Protect stored secrets with at-rest controls that limit pre-access exposure.
CIS Controls v8CIS-6 — Access Control ManagementCE storage supports restricting access to sensitive local credentials.
Recommendation — Limit where sensitive credentials are stored and who or what can reach them.
OWASP ASVSV14 — Data ProtectionThe subject is about protecting secrets stored on a device.
V9 — Self-contained TokensThe term directly affects how token material is stored and protected.
Recommendation — Place sensitive data in storage patterns that reduce unauthorized disclosure. Protect locally stored tokens so they are unavailable before the intended trust state.

Practitioner Guidance

What to watch for: Treat any token, API key, refresh token, or secret that survives reboot as a review item. If the app genuinely needs it after unlock, CE storage is the default place to keep it. If it does not, the better answer may be to stop storing it locally at all and fetch or mint it when needed.

Practitioner takeaway: Use CE storage for secrets that should not be available until the user has unlocked the device, and pair that choice with rotation and revocation assumptions, not permanence.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on November 26, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org