Sample Header Ad - 728x90

How do you decrypt an f2fs partition?

0 votes
0 answers
339 views
I have got an encrypted f2fs image, I know the password, I'm able to mount it via sudo mount -t f2fs mmcblk0p64.img /mnt/mmcblk0p64 so it doesn't appear broken or anything, and f2fscrypt recognizes the policy
f2fscrypt get_policy /mnt/mmcblk0p64/data                                     
/mnt/mmcblk0p64/data: 17532673d8ab1f9f
however
fsck.f2fs -f mmcblk0p64.img
Info: Force to fix corruption
Info: MKFS version
  "4.9.206-perf+"
Info: FSCK version
  from "4.9.206-perf+"
    to "Linux version 6.5.7-060507-generic (kernel@sita) (x86_64-linux-gnu-gcc-13 (Ubuntu 13.2.0-4ubuntu3) 13.2.0, GNU ld (GNU Binutils for Ubuntu) 2.41) #202310102154 SMP PREEMPT_DYNAMIC Tue Oct 10 22:00:30 UTC 2023"
Info: superblock features = 481 :  encrypt verity quota_ino
Info: superblock encrypt level = 0, salt = 1a9ecca697dd4d1b9eb0d41a55754d41
Info: Segments per section = 1
Info: Sections per zone = 1
Info: total FS sectors = 104939480 (51239 MB)
Info: CKPT version = 9d277d6
Info: checkpoint state = 44 :  crc compacted_summary sudden-power-off
prints this salt, and when trying to use it to add a key like this:
f2fscrypt add_key -S 1a9ecca697dd4d1b9eb0d41a55754d41
Invalid salt: 1a9ecca697dd4d1b9eb0d41a55754d41
it fails. Is this the wrong salt, where do I get the salt for this purpose? The img comes from a broken android device, running kernel 4.9.206-perf+ f2fs-tools version f2fs-tools/mantic,now 1.16.0-1 Using twrp is not an option, it fails to decrypt it via the shell and the screen is broken. I need to be able to decrypt it on my computer.
Asked by sezanzeb (401 rep)
Apr 4, 2024, 07:34 PM
Last activity: Apr 4, 2024, 07:46 PM