Decrypt internal sd after wipe - X Play Q&A, Help & Troubleshooting

Short question here.
- I took the, as internal storage formatted, sd out of my Moto X Play
- Wiped to solve Marshmallow battery drain bug
- Put the sd back in
- aaand the phone doesn't recognize the card anymore.
Apparently an sd formatted as internal storage is encrypted to prevent data theft in case the phone is stolen. The key was apparently stored in '/data/misc/vold' and is therefore lost after the wipe.
I found a similar question here: http://forum.xda-developers.com/moto-x-style/help/to-decrypt-micro-sdxc-formatted-t3360169
Except of a few images from last week in vsco, everything on the card was either google photos or spotify data. So I have a backup of 95% of the stuff.
Is there a way to retrieve the key? Does Google back it up? NSA? Or to brute force? The encryption caught me really off guard so I wanted to shoot a last attempt before I format the card.
Thank you for your help guys. :good:

As far as I know, formatting the card is your only option.

Brute force
Thank you lenny, first of all.
I made a full image of the mentioned sd card using the default mac os x disk utility tool.
I hope to be able to brute force my encrypted sd card in the far far future. Is the mentioned system image the way to go? Having 64 gb of an unreadable encrypted sd card image on one of my external hds doesn't hurt, however im obviously a noob. Therefore i am not sure if the system image will be sufficient to brute force it one day.

Related

Upgrading SD card without losing config

Hey there,
I was just wondering if we are able to change an sd card without losing the configuration and apps.
Is it possible to make an image of the complete old (small) sd, then restore this to a bigger one with resizing the data partition to fit the bigger sd card.
Anybody tried this?
thanks,
Neo
It's a good idea,but have a lot of data in sd card now.
Have anyone try it that just flash wp7 on HD2 or other dev.
Sorry 4 my English
Hmmm, intresting idea, i would say the first step is to try a complete copy, i mean, lets assume you have a 4GB SD card, go get another one and ghost it to the new one, exactly the same partitions and content.
if that works the next step would then be trying to edit the partition table to increase its size to a bigger card.
If thats possible i think the only other sticking point would be the OS its self
Someone has had an intresting experience on here which may suggest WP7 has some kind of recovery/safe mode, basically the chap did something to his SD card, he restarted and all of his apps an data were all gone, restarted again and it was all back again.
it was almost as if WP saw there was a difference, stopped its self to check everything was ok then carried on as normal.
Dont for a second assume you can back up your data doing this though, a hard reset on the phone would render the data on the card useless

[Q] Help with rebooting.

Just looking for some help guys.
A few days ago my phone suddenly dropped from 20mb free space to 4mb and wouldn't stop giving me the warning about available space.
SO I remember this was an issue with people who upgraded to Froyo. So I decided to wipe my phone. after the wipe the phone started rebooting everytime I installed/upgraded an app.
So I loaded up RSD Lite and flashed Froyo on it and the phone now randomly reboots about every 2 mins. I even tried downgrading to eclair, but it just gives me errors when the flash is complete.
So just looking to see if anyone has any recommendations, or is my phone destined for that great recycle bin in the sky?
Hi!
Well, I belive that I may remenber a similar issue some months ago... I dont remenber well how I really fixed and I almost sure that it fixed by reflashing again with froyo, sine this is the only resource that I had to try it out... also seems that when You upgrades to Froyo is not possible to downgrade/return to a previous android version (and it seems that is not only in FlipSide, so seems the same for other Moto models...)
so, by the way, I may suggest... Remove Your SiM and SD memory cards, Put the phone in flash mode an reflash the froyo again, and also backup you personal files from Your SD memory card and erase everything from SD memory card (prefer reformat your SD card) and then when Your phone reboot normal and after an initial setup BEFORE recopy your personal files, AGAIN reformat WITH YOUR PHONE MENU OPTION Your SD card and do an factory restart... may sounds silly so lot of erase and wipes... but in my case, after this such harsh cleanning make my trouble phones working fine and stable again, and after that I restore again my personal files to my SD card.
Good luck and best regards!
xaser66 said:
Hi!
Well, I belive that I may remenber a similar issue some months ago... I dont remenber well how I really fixed and I almost sure that it fixed by reflashing again with froyo, sine this is the only resource that I had to try it out... also seems that when You upgrades to Froyo is not possible to downgrade/return to a previous android version (and it seems that is not only in FlipSide, so seems the same for other Moto models...)
so, by the way, I may suggest... Remove Your SiM and SD memory cards, Put the phone in flash mode an reflash the froyo again, and also backup you personal files from Your SD memory card and erase everything from SD memory card (prefer reformat your SD card) and then when Your phone reboot normal and after an initial setup BEFORE recopy your personal files, AGAIN reformat WITH YOUR PHONE MENU OPTION Your SD card and do an factory restart... may sounds silly so lot of erase and wipes... but in my case, after this such harsh cleanning make my trouble phones working fine and stable again, and after that I restore again my personal files to my SD card.
Good luck and best regards!
Click to expand...
Click to collapse
THanks, I think you're onto something with the SD card. I remember months ago I had an issue with the phone rebooting if I had this one certain SD card in my phone. Thanks for the help and joggin my memory.

Need to decrypt micro SDXC that was formatted as internal storage on my Moto X Pure

So recently my device stopped recognizing the SanDisk 64gb micro-SDXC I had formatted as internal storage. As far as I am aware when you format a SD this way the phone turns it into an encrypted volume and stores the key on internal storage, presumably somewhere the user cannot normally access it. The card itself is not dead, plugging it into my computer verifies this, but I cannot access it. I think some write operation failed and made it invisible to the phone. the phone did the same thing to a 128gb PNY card, but I reformatted it on PC, then reformatted it again on the phone and now the PNY is working fine. my question is, is there any way to extract the encryption key for my 64gb card(Root based tool or otherwise) from the card profile on my phone and decrypt it on a PC so I can reclaim my data? The phone still has a profile for the card, so presumably the key is still in internal storage somewhere. I had about 40gb of media on that card that I had not backed up (photos, videos, music and such). My ohone is not currently rooted but i wouldnt mind rooting it if someone has a root only solution.
I would wipe cache, then data then try another ROM.
sciencetor2 said:
So recently my device stopped recognizing the SanDisk 64gb micro-SDXC I had formatted as internal storage.
Click to expand...
Click to collapse
It is possible, though I have not done it before, I avoid adoptable storage for this reason. Do NOT wipe your ROM, or you will permanently lose your encryption key to your data that you have on the card.
If you put the SD card into a Linux PC that can recognize the partitions (Windows will not show it), you will see two partitions, android_meta and android_expand. To decrypt the big one, android_expand, you will need to recover your key from the phone.
To recover the encryption key, you will need either root access or a custom recovery like TWRP, to access '/data/misc/vold' to retrieve the encryption key (aes-cbc-essiv:sha256). Save the .key file to somewhere safe.
Then something like
dmsetup create crypt1 --table "0 `blockdev --getsize /dev/sdb2` crypt \
aes-cbc-essiv:sha256 00010203040506070809010a0b0c0d0e0f 0 /dev/sdb2 0"
mount -t ext4 /dev/mapper/crypt1 /mnt/1/
More info here - http://nelenkov.blogspot.com/2015/06/decrypting-android-m-adopted-storage.html
Once you have recovered your data, reformat the card and use it as portable storage
SenK9 said:
More info here -nelenkovDOTblogspotDOTcom/2015/06/decrypting-android-m-adopted-storageDOThtml
Once you have recovered your data, reformat the card and use it as portable storage
Click to expand...
Click to collapse
(url edited due to new user restrictions)
Thank you! this is exactly what I was looking for, but i couldn't find anything on google about anyone figuring out all the details (encryption key location, encryption method, usable tool for decryption)
now is there any way i can root, extract the key, then unroot so that i can RMA the phone? It seems to now render any sd i put into it unreadable by itself within about 5 minutes of formatting, regardless whether i format as internal or portable. not sure if this is hardware (reader malfunction) or some software is writing to the card incorrectly, but it is now doing it consistently.
sciencetor2 said:
(url edited due to new user restrictions)
Thank you! this is exactly what I was looking for, but i couldn't find anything on google about anyone figuring out all the details (encryption key location, encryption method, usable tool for decryption)
now is there any way i can root, extract the key, then unroot so that i can RMA the phone? It seems to now render any sd i put into it unreadable by itself within about 5 minutes of formatting, regardless whether i format as internal or portable. not sure if this is hardware (reader malfunction) or some software is writing to the card incorrectly, but it is now doing it consistently.
Click to expand...
Click to collapse
I do not believe it's possible to root or change the recovery without unlocking the bootloader, unless there's some other method I'm not aware of. Even MM systemless root method - http://forum.xda-developers.com/mot...t-moto-x-style-xt1572-br-marshmallow-t3259380, requires unlocking the bootloader, which of course then technically voids the warranty.
However, in this case, it might be worth contacting Moto to inform them of what's happened, it's definitely some kind of bug in the software which has caused this, and thus you are stuck in this catch-22 situation. They might make an exception or have some other solution. Let us know how you go.
SenK9 said:
... requires unlocking the bootloader, which of course then technically voids the warranty. ...and thus you are stuck in this catch-22 situation.
Click to expand...
Click to collapse
Even more of a catch 22 situation, because if i read that correctly, the process for unlocking the bootloader also requires wiping the phone (and thus, the encryption keys) (i miss geohot with his 1 click soft roots). I will wait a little while and see if I or anyone else reading this thread can find a way around that, but it seems ill have to contact Moto support either way, since my 16gb model is barely usable without an SD card.
This is another example of why taking control of your phone before something goes wrong is so important.
Did you try wiping cache yet?
lafester said:
This is another example of why taking control of your phone before something goes wrong is so important.
Did you try wiping cache yet?
Click to expand...
Click to collapse
I checked the recovery menu but there didn't seem to be an option for wiping cache on this device (recovery menu was a little different than I am used to, only had option for factory reset) Also, while wiping cache might conceivably prevent it from screwing up future cards, I don't know if it will fix this one, and i'm not sure if i wanna risk wiping anything without getting my hands on the encryption keys first. if it becomes apparent that i'm just not getting root without wiping, then I'll try playing around with recovery options to at least get back SD slot usage.
You can erase cache in fastboot. If you are locked there is no way to root without wiping data.
lafester said:
You can erase cache in fastboot. If you are locked there is no way to root without wiping data.
Click to expand...
Click to collapse
Isn't that what the setting "OEM Unlocking" under "Developer Options" is for? I thought I read that, if you enable this option before you unlock the bootloader, it allows you to unlock without the wipe/factory reset?
YITBOS said:
Isn't that what the setting "OEM Unlocking" under "Developer Options" is for? I thought I read that, if you enable this option before you unlock the bootloader, it allows you to unlock without the wipe/factory reset?
Click to expand...
Click to collapse
I hadn't heard that... Got a source?
YITBOS said:
Isn't that what the setting "OEM Unlocking" under "Developer Options" is for? I thought I read that, if you enable this option before you unlock the bootloader, it allows you to unlock without the wipe/factory reset?
Click to expand...
Click to collapse
No all that does is allow you to unlock (providing you have a key of course).
well it looks like nobody has found a non wiping solution to root my phone, so I'm going to have to give up on the data and see if I can get back SD functionality, or just RMA the phone. I think i will also publish a script that allows you to plug in your phone and the SD at the same time and allow you to decrypt an internal formatted card by pulling the keys and using them to mount the drive to help people who are in similar situations, but have root. Thanks anyway for the help.
Hi Everyone, I'm stuck in the same catch 22 situation. Device is not rooted or bootloader unlocked, so can't access the key, and trying to root/unlock bootloader will wipe the keys. Any updates, @sciencetor2??
Have you written to Motorola/google about this?
I'm still not ready to give up on the data... hundreds of vacation pictures, that couldn't get backed up.
I'm in the same boat any good news on this?
As long as the phone can see the card, you can change it to portable storage. However, if something goes wrong and phone can not see the card anymore, it's nearly impossible to access the volume without the retrieving the key from the phone, and you must root the phone in order to get the key, as I understand.
I have another similar problem, SD card becomes locked writing and disappears from phone, even I used it as portable storage. And the card can't be formatted at all. So I believe the phone somehow does something and change the state of SD card!
Did anyone find a solution yet. Stuck with same problem. Will loose very important data.
Same here.
I adopted my sdcard as internal storage in CM13.
It was constantly in bootloop, so I formatted the internal memory of the phone to install a new rom ...
But now I can not recover the data within the sd because I can not access it nor with the new rom (I can not even mount it from TWRP) nor from a linux PC (the filesystem is unknown).
Pretty much ... I did not know that the sdcard adopted were encrypted!
Any solution? :\
Hello everybody!
Is there any way to recover the deleted ".key" file?
so i havent gotten back on this thread in a while but i think i at least figured out the "why" on why the card was no longer being recognized. it seems to come down to read/write speed. my 64GB and 128GB cards that i was having the issue with were both U1 cards, which means their read/write is only sitting around 10Mbps, and both of those had issues being detected by the phone after a little bit of time in use. I replaced the card in the same phone a few months back with a high throughput U3 card, and it has been running smoothly ever since. this leads me to the hypothesis that if the card is not fast enough for the phone's taste, it will just ignore it (or timeout on reads, not sure which is actually happening) which is leading to the issues we are experiencing. unfortunately this doesnt lead us to a solution for recovering from the existing cards, but hopefully it will help avoid making the mistake of using a slow card in the future.

[HELP] Internal SD Card "Unsupported". Cannot access files.

Hi everyone,
I have a S5 klte with Samsung SD card formatted as Internal Storage.
Yesterday, I thought I will update my Slim rom 0.6 to the newest version 1.3. After flashing the rom, wiping cache and dalvik cache phone stuck on boot animation. Now, the stupid thing I've done was to push "Fix permissions" in TWRP recovery. After that, I was able to boot my phone, but it lacked most of the apps which were installed previously, none of the google services would work, I could see all the pictures/videos in my gallery, however. When I tried to backup those to my PC, I could see only a small part of it. Tried flashing previous rom, different gaps, wiping cache - nothing.
Then, I thought, I will do a regular wipe, since I didn't cared much about lost apps. From the experience I knew, that wiping does not touch media stored in internal storage. So I wiped my phone and restarted (with old slim 0.6 flashed before).
Now the phone works great, but there is HUGE problem. All internal storage is gone including pictures and videos and Samsung card, which was formatted as internal storage, now says "Unsupported card" and asks me to format it either to external or internal.
What could I do? Is there any way to "re-link" the internal card so that I could see its contents? Or I should use some file recovery software and see what I can get?
Thank you in advance for the help!
Did you try popping out your SD card out of your phone and using an SD card reader to get data off it onto a pc
Sent from my iPhone 4s using Tapatalk I also own a g900v
Well, I am using Mac for the moment, so when I try to connect sd card to it the notification pops up, that drive is not accessible, or something similar.
Tomorrow I will be able to try it on PC, but I believe nothing will change. The biggest problem is that sd card is formatted as internal storage and linked with phone's internal storage. I do not know these inner mechanics, but I believe that I need to somehow recreate that link.
Hmm your probably right good luck trying to fix it
Sent from my iPhone 4s using Tapatalk I also own a g900v
Sadly, there is not much of info due to complexity of this issue. Still waiting for at least some hints what should I do...
UPDATE: PC does not respond to the sd card at all, there is no sound, no drive, nothing.

Retrieve data from unreadable adopted storage card

I am not the author of this, it is from https://android.stackexchange.com/q/174799/146132 but it has some great info I thought I would share... My thanks to the author.
About a month ago the Moto G (3rdGen) of my wife was not able to recognize the SD-card 32GB Trancend premium 400x (which was formatted as adoptable storage) anymore. On this card were very important pictures and movies for us (of our new born baby). As of a certain Android version the adoptable storage is also encrypted and reading it on a PC or other phone is not possible without the encryption key. Since the phone was also not rooted it was also not possible to get the encryption key from the /data/...something directory... (see https://nelenkov.blogspot.ch/2015/06/decrypting-android-m-adopted-storage.html) So I almost gave up hope...
I bought the exact same type SD-card, also 32GB, only about a year later. Hoping that I would be able to make an exact clone of the card and I would be able to start some experiments with it without the risk of destroying something on the original card and losing all the data. When I mounted the original card under Linux it shows two partitions 17MB and about 31GB. Cloning the card with some Linux command line tools didn't gave me the same result. Next thing I tried was cloning it using HDDrawCopy, first write the entire card to an image on my harddrive. When I copied the data to my new 32GB card I noticed that the new card did not have the same capacity of the image file (image was 32.22GB, new card shows capacity of 31.11GB) so hmmmm that trick doesn't work... Luckily I also happen to have a 64GB SDcard (same type) which should have enough space for this test. So using HDDrawCopy I wrote the image to this card. Checked under Linux if I see the same partition as with the original card and this happens to be (of course it also shows about 32GB of free space not partitioned).
So I thought lets see if the Moto shows the same error with my new card in the phone and that I made an image on which I can start to try to hack the encryption off(now or in the future). To my surprise the Moto shows immediately that the transcend 32GB volume is mounted! I went to the gallery of the phone and IT SHOWS OUR PICTURES AND MOVIES again!!!
So in short when this happens buy a larger volume SD-Card (to make sure that there are enough data-block available). Use HDDrawCopy to make a bit-wise clone/image of the original card. Write the image to your new card and check if it can be read by your phone.
Never do the following or your data will be lost:
Format the cardSet your phone back to factory default (destroys your encryption key)Make the phone to forget/unmount the storage location (also destroys encryption key)upgrade to a newer version of Android (or any other major system update).
(of course make sure to make backups or cloud syncs to prevent this situation at all)
I hope this can help someone out there who might ended up in the same situation.
Unfortunately I have clicked on forget the card. Can anything be done?
Unfortunately I have clicked on forget the card. Can anything be done?
ajparag said:
Unfortunately I have clicked on forget the card. Can anything be done?
Click to expand...
Click to collapse
Unfortunately, no... When you click "Forget" the unlock token is erased and not recoverable by normal means. The daya stored on an internal SD csrd is now lost forever.
Hi, I am in a similar situation. I have a marshmellow phone with an sd card set up as adopted storage, but the phone stopped working and I needed the memory card somewhere else so I took an image backup of the SD card Partition. This is the mistake I did, should have taken the entire disk image backup. So now when I restored the image and the phone is fixed, the phone doesn't recognizes the memory card even though it still has the encryption key.
Any ideas?
The partition table is correct, the first partition "android_meta" probably has the wrong info

Categories

Resources