File Based Encryption

08 Aug 2025

Unlock the Screen, Not the Secrets

If you're a big android nerd in 2025, using a rooted android. You might assume root just straight up means unlimited access. You fire up your adb or a root shell if you are feeling fancy while your device is locked, try to list out some things from /data/data and see cyptic shit..

Here's what going on..

#FBE (File Based Encryption)

Modern android devices especially since android 10 and above applies FBE. When your screen is locked, certain folders especially app data remain encrypted using a key that is only available after you unlock the screen. So even if you're root, even if you're in ADB shell, even if you mount /data — you won't see the real data. Instead, you'll see files and folders that:

This is the result while accessing /data/data in a locked device

Screenshot

This is the result while accessing /data/data in an unlocked device (used iceraven-browser for example)

Screenshot2

#Exceptions in directories

/sdcard/ or data/media/0/ these locations are device-encrypted only. It means you can access them even when the screen is locked. They generally don't contain sensitive app data, most apps store their sensitive data in data/data .

#Bypassing the encryption when locked

(not sure, if you can get it to work totally)

  1. Make a magisk module which detects when the screen is unlocked where the data gets copy files from /data/data/(appname) to /data/media/0/(appbackup)(well, this is not real-time access stuff, its a cache of data when unlocked)
  2. Disable FBE(highly not recommended){it's just generally incompatible with new android APIs}

#How FBE works in precision

Android uses fscrypt, the Linux kernel feature than enables FBE:

(for basic understanding of CE keys and DE keys)

Key TypeUnlock TimeAccess LevelExample Uses
CE KeyAfter user unlocksusr-specific/pvtmessages, app datas
DE KeyImmediately after bootdevice-wide/publicincoming calls and lock screen notis


/sw-load.js?v=e5ae5a1ed170f4499ac6292e7164b68528c51f6d6518cd75a49e6a6b737831d5728da21fc14dcbc7a91328e53858c6ff7195cc3fc8b25f0feeaef2af151d6686 /fireball.gif?v=569e393374f2af74d6c575090904aaf51e641e5eb5ea89ae7c7de01f7293abc165b3a7e8685690a8b951c778603fec98ae6822ff2f7ea86a536776966cb65d5d /favicon.ico?v=1248e6c8998a6def1d56692ca52fffb9b51120fb209d489ede117510f16e83bab22268caa98bebde647b64b0ef30e7d9ed5213bb3e7de46257649a5f868b9376 /favicon-16x16.png?v=1248e6c8998a6def1d56692ca52fffb9b51120fb209d489ede117510f16e83bab22268caa98bebde647b64b0ef30e7d9ed5213bb3e7de46257649a5f868b9376 /favicon-32x32.png?v=c124eca371282c0bc4d1747a7696eb48f5c71fed14259025ee577959dab8b6bbb86d3de25572e836f48308015cb5dfe2eac72bfd9e0a4f9c1c6e1d3bb4d60fa2 /icon-192x192.png?v=69a23366f0c81270d1f002f2b707cb7b15a429ffdada2bba0c0a85ac338d2060f2ad0212ffc1cd487f091ae4127ec4c4bb05a5b39af3fd00d362a6c2e38edfca /icon-512x512.png?v=fe349d0dce49dcb8cf68e8c56860da1fbab43ed477176280c6f8bf6587315f8461aa3a0c445167fcebe4933d2edaa2f38d027a85ea3038b5bcfa4f2c9a429848 /apple-touch-icon.png?v=a085ab426ba04fb5da3d5c806c175fa22d67ac824c4940858529f00079ea1854813939437755588f2a768445f7a41d774cb709296ea442d2254325d91b52c5cc /main.css?v=ddf26e31809f33fa85997d29263c8723c5e3ec063dc997b454ff3bf1da89ad1007561c7d650efe968e47081992bb9a961cfb0a01a60382c189a7e54af06b0dfd /nerd-fonts.css?v=4b2ec75c55a664da78189dc20d4017cf5bc817cf3b60218a2446ba269ca4fd42c117352d5276363965f35fae32891efce751e0626b5281bae627f40d804a5679 /unstyle.css?v=b14bd48a2efbd463d973763aa3184c69aa02164c0891acacc9eab49ddd275f98f0050b4c31d2093e4671e7abe04f9459a041f0064384a90d97b8ff21b6824825 /langs.css?v=12474958ee314a9fde4704e1f5a032dc632d41f9461faca326ac284297766c4ceb07b45fec7fbc09fa72b0f21dcc64f0c31e64fc2e5e838b1d30f5fe540afd78 /syntax-theme-light.css?v=ccdddc2d2d88953c6d7d0376777b8409028ef625a7321dfa41619547b4f5eddbe89aa95ff5e7e2620da0ea13fbabebe2fd544620bc7e81e3294776b3425df48a /syntax-theme-dark.css?v=dfede4879841e4a58e5fc71115aa5f5b82e206d85eb771ff4e5a40a1d82621570aad2458f637365ae4370d9a1cf5070edc9765f7c2d4506e12e2ba3c6081ffd5 /sw-style.css?v=a0fa1e87fa2bb3e03d18cefc81ef5c8cfa58c6aa6eea0af223fa155e088bc5af22d32d3ee785ebd3fc26b4c49b70f0bd423f7d592a419a24e6d1e2cb720b7e05 /categories/ /categories/Android/ /tags/ /tags/andorids/ /tags/concept/ /tags/research/ /tags/security/ /posts/File-Based_Encryption/ /posts/Android_Intents/ /projects/ /posts/ morindex.png?v=0e754586c1567cf7fb85e3f01a723d9b19a69e5540a057c3ac2c8c20b687ec8c8d7a604b5584f5650feb66f7ef351984e63bef8e640dd73773712c40071952ea mori2.png?v=31e46048ac7b46651a842d1c411b8ebd218016c025a2e873257262b1a3210e19200d27d0edd3939933a8114c64758b48c7655c0fa9d786a96beeffa9d6a1ce5f msh.png?v=4c2b5dd0fd339993a59cb8d43091104ee3cf4e3a85f0cadf35001ea1fdffd37aa7e5ca6a566d050378fa371092068289a805a22ff648d3c901a47f82b49953cc /icon-192x192.png?v=69a23366f0c81270d1f002f2b707cb7b15a429ffdada2bba0c0a85ac338d2060f2ad0212ffc1cd487f091ae4127ec4c4bb05a5b39af3fd00d362a6c2e38edfca /glitch.css?v=0b9b7f8691385df5b832251e9cf4c56d68cbcfc98c6e4c27e015f6fb29d2f0c18c358c98c0e7e0a1da9f263d6b355b811e49aac099b70889090912a5040f754a /search_index.en.json /search.js /elasticlunr.min.js?v=d106ab529e29f6be48a948124723fcf411e06b8e4ea4477b551f256d190991fe3ca7f121714ef8d9f594a4aa680f2bbd37a5d8004abfbf3ea6eb3d4ea259ec0f">