How to get the key used for the encryption of sdcard (internal storage)

Hi

my boss did it. Unforunatelly he used his SD-card as internal storage and now has the “typical” problems.

I made a copy of the sd-card (linux dd), but accoring to the #sdcardguide “any data stored on the SD card is encrypted… The key used for the encryption is stored in the device. :warning: Factory resetting your phone deletes the key and renders any data on the SD card unreadable”

Where can I find the key and how do I extract it.

I just don’t want to accept that everything is gone! (and my boss doesn’t either)

Marco

The theory is there is no easy way to decrypt else it would be much use to encrypt, maybe someone is a great hacker, but they post the answer here it will open a can of worms.

If there is a key it would be better if Fairphone could help privately, but I doubt they can.

If you boss hasn’t reformatted the card and the internal memory the best was is to connect a pc and download or upload to a server and then retrieve.

Good luck :frowning:

1 Like

I’m using an FP3+ with Android 10. And got a new SD card. And had a bad idea.

I got a new microSD card and was so enthusiastic about it that I replaced the old card without saving my data. I was convinced that this old card was not in use.

So I inserted the new card, attached it as adoptable storage. And then realized that the recently shot photos disappeared (luckily, I had the “old” microSD card only some weeks in place).

So I switched cards again, but the Fairphone didn’t recognize the old one. I tried to read the data on my laptop. Without success, there are two partitions “android_meta” and “android_expand” on the card which can’t be read. I know now this means, the card is encrypted and was used as adoptable storage.

I used Linux and dd (without any specific options) to write images of both partitions in img files (again I had some luck, the card has only 8GB). Then I had the idea to let the phone use the old microSD card again as adoptable storage, shut down the phone, then restore the dded images and boot the phone with the old card and the restored data. Unfortunately, the phone told me the card was broken.

Now I hope there is a chance

  • that the dd command was correct and did not produce corrupt images
    From the web I got that one might want to use gddrescue for andoptable storages.
  • that it’s possible to extract the encryption key the Fairphone used to encrypt the adoptable storage.
    Again, I tried to get information about this on the web. And it seems, each encryption key is preserved. Which would be good. But I used this exact microSD card twice as adoptable storage :frowning:

Thanks in advance for any useful hint
Newlukai

Welcome to the community forum.
I moved your post here to avoid duplicate topics.

Yeah, it shouldn’t be too easy.

It sounds like @marcseid is referring to the “typical” current Android 10 bug with an SD card used as Internal Storage. In this case I thought the data on the card would not be accessible anymore via PC connection.

2 Likes

Hmm. There is an instruction on Android Enthusiasts on how to decrypt an adoptable storage. To achieve this one needs to get the encryption key from /data/misc/vold. And this is possible on a rooted phone.

On the Fairphone support site I didn’t find a hint on how to root a phone, but there is a description on how to unlock the bootloader, but it claims it will wipe all the data on the phone.

So I’m wondering if it’s possible to root the phone without loosing any data.

1 Like

Interesting, but I wouldn’t get my hopes up too high, the instructions are over 4 years old.
Over at the /e/ forum it was mentioned that possibly there was progress in that regard …

But according to what I know it is stored in a secure environment and even if you are rooted you can’t just access any “decryption_key.txt” file. Same thing for iPhones for instance.


That’s correct. Unlocking as well as locking the bootloader will force a factory reset for security reasons.
Unlocking the bootloader is not the same as rooting the phone, but as I understand it you need to have an unlocked bootloader in order to be able to root the phone.

Has anybody contacted Fairphone about this?
They reintroduced the easy way to incorporate an SD card into Internal Storage after they initially (and wisely) delivered the Fairphone 3 with Android 9 without that possibility.
Now they have a bug in their Android 10 which apparently causes data loss with this setup.

3 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.