Accidentally wiped encryption keys. Can I re-encrypt and make new ones? - OnePlus 6T Questions & Answers

Hey there. While I was installing a Custom ROM, I did something incredibly stupid by factory resetting my phone whilst it was encrypted, thus effectively erasing the encryption keys. I am unable to access my data from things such as TWRP because no password is accepted.
Is there a way to re-encrypt my device with new encryption keys? I understand that I will not be recovering the keys I wiped so I figured if I started with an entirely new encryption, I would be able to create working keys again.
I am completely fine with losing personal data on this device.
Thank you.

JC_6a63 said:
Hey there. While I was installing a Custom ROM, I did something incredibly stupid by factory resetting my phone whilst it was encrypted, thus effectively erasing the encryption keys. I am unable to access my data from things such as TWRP because no password is accepted.
Is there a way to re-encrypt my device with new encryption keys? I understand that I will not be recovering the keys I wiped so I figured if I started with an entirely new encryption, I would be able to create working keys again.
I am completely fine with losing personal data on this device.
Thank you.
Click to expand...
Click to collapse
Pretty much anytime you find yourself in a pinch like this, the MSM Download Tool here on XDA is the best way to go. Have you tried that?

You can also try an OTG with pen drive. It's not encrypted so TWRP can read and flash files from it. Then clean flash a ROM.

Thank you both for your help. I will try these out later.

JC_6a63 said:
Hey there. While I was installing a Custom ROM, I did something incredibly stupid by factory resetting my phone whilst it was encrypted, thus effectively erasing the encryption keys. I am unable to access my data from things such as TWRP because no password is accepted.
Is there a way to re-encrypt my device with new encryption keys? I understand that I will not be recovering the keys I wiped so I figured if I started with an entirely new encryption, I would be able to create working keys again.
I am completely fine with losing personal data on this device.
Thank you.
Click to expand...
Click to collapse
Try simply to format data

Can I resurrect this thread, because I just did the same, stupid thing?
After a long time on the OB releases, when jumping to tresk I had forgotten the proper procedure so, of course, I ended up not able to access the FS from TWRP. I can see everything fine after I've booted, of course.
@VampireHeart I *had* formatted Data (actually, System, Data, Cache) before flashing so I'm not sure this will help?
@devilrulz4ever the OTG is a nice idea, but what is the proper 'clean' process? I must be getting old...
Thanks!

krakout said:
Can I resurrect this thread, because I just did the same, stupid thing?
After a long time on the OB releases, when jumping to tresk I had forgotten the proper procedure so, of course, I ended up not able to access the FS from TWRP. I can see everything fine after I've booted, of course.
@VampireHeart I *had* formatted Data (actually, System, Data, Cache) before flashing so I'm not sure this will help?
@devilrulz4ever the OTG is a nice idea, but what is the proper 'clean' process? I must be getting old...
Thanks!
Click to expand...
Click to collapse
Format data isn't wipe data, you find it at bottom of the screen into clean section, when you tap on that you may enter yes and confirm to make it, are two different thing.

Related

Phone won't boot since I encrypted the storage

I have a Samsung Galaxy S4 i9505 (unlocked version). It was using the stock v4.4.2 but it was rooted and the bootloader was unlocked, I also had a different Recovery installed (Can't remember which one but it wasn't Clockwork). I am no longer using the phone so it doesn't contain any data that I need. I was preparing the phone to sell it so I decided to encrypt the storage as I read that that doing this would remove any possibility of old data being taken off.
During encryption setup, I had to enter a PIN before I could have it encrypted so I entered one. Once it finished encrypting (took quite a while), it rebooted and asked me for the PIN to decrypt the device, I entered the PIN. It seemed like it accepted this but then it rebooted. It kept doing this so I thought no big deal as it probably already achieved what I wanted. So I did a factory reset via the Recovery. However, the encrypted partition still persisted after the factory reset.
So then I decided to use Odin (v3.09) along with the latest stock ROM (v4.4.2 I9505XXUGNG8) to write over the whole phone thinking this would reset it. But the encrypted partition still persists and it keeps rebooting after I enter my PIN.
How can I completely factory reset the phone including removing the encrypted storage? I don't need any data on the phone, just need to reset it completely back to factory.
TIA
Probably flash a custom recovery and then:
In TWRP, under "Wipe" menu, there is "Format Data" function, which will effectively remove the encryption from the device
(alongside with all the data of course).
ps the information you had about encrypting your device is wrong. Basically when you delete a file from you phone, there is no way currently possible to get it back. That is caused by TRIM. Not even professional companies can restore it as of yet. So once you delete it, it's really gone.
Lennyz1988 said:
Probably flash a custom recovery and then:
In TWRP, under "Wipe" menu, there is "Format Data" function, which will effectively remove the encryption from the device
(alongside with all the data of course).
ps the information you had about encrypting your device is wrong. Basically when you delete a file from you phone, there is no way currently possible to get it back. That is caused by TRIM. Not even professional companies can restore it as of yet. So once you delete it, it's really gone.
Click to expand...
Click to collapse
Ok, I'll give that a go.
This is a similar article to what I read about needing to encrypt the device to truly remove your personal data: http://gadgets.ndtv.com/mobiles/fea...elete-all-data-from-your-android-phone-603731
What about files that haven't been explicitly deleted? Say for example if I left all the files undeleted but I just did a factory reset, will those files be recoverable? That's what I want to protect against.
Techno79 said:
Ok, I'll give that a go.
This is a similar article to what I read about needing to encrypt the device to truly remove your personal data: http://gadgets.ndtv.com/mobiles/fea...elete-all-data-from-your-android-phone-603731
What about files that haven't been explicitly deleted? Say for example if I left all the files undeleted but I just did a factory reset, will those files be recoverable? That's what I want to protect against.
Click to expand...
Click to collapse
That articel is mistaken. As of Android 4.3, files that are deleted can't be recovered. A factory reset should be enough. It will also wipe your internal storage.
Thank you. Phone is all sorted now and back to a factory reset

Fingerprint hardware unavailable? Enrollment didn't work?

Recipe:
TWRP 2.8.7.2
TWO Nexus 6Ps on 6.0.1
One N6P systemless rooted
Official Android SDK (fastboot)
So I got a replacement N6P from Fi as I noticed some slight bending on my original, and I was working on moving my data over using TWRP so I could keep all my app data, etc. When I backed up my original 6P, I forgot to remove screen and boot security, so when I flashed on to my new 6P, I was locked out (as expected, known bug). I tried this fix to get in to my system, and it worked! I was able to log in. However, I noticed that my old fingerprints were still enrolled and I wanted to start those fresh, so I tried to remove them. When I selected "Delete" for each enrolled fingerprint, nothing happened. This was the first clue. I then tried to enroll new fingerprints and got the following message:
Code:
[B]Enrollment was not completed[/B]
Fingerprint enrollment didn't work. Try again or use a different finger.
The other odd thing is that on the lockscreen, I was getting a red text error message that read something like "Fingerprint hardware not available."
So I figured something got messed up security wise from the fix I tried after flashing a locked nandoird. I then went back and made a new nandroid backup (boot, system, data) on my old phone making sure that all security was turned off. Same thing!
Wondering if the hardware did actually get messed up somehow, I flashed back to official stock 6.0.1 from Google. Fingerprinting then started working!
So nothing I have done since then has made any difference when trying to restore my userdata from my old phone. I've tried wiping cache/dalvik, and removing the locksettings.db file, but these didn't change anything either.
Has anyone had this issue before? It seems really bizarre to me. I'm probably going to end up flashing stock and restoring userdata via TB, but that is a headache compared to nandroid so if possible I'd like to get this to work.
Tried wiping userdata then flashing userdata from my old 6P and that did not work either.
Have you tried wiping data, setting up the device again, and then checking if you can add a fingerprint?
I tried restoring data from a device I had to RMA too, and got that exact message every time - I gave up in the end as I tried wiping everything but the only thing that worked was clearing userdata & restoring my apps from the nandroid via TiBu.
All in all, I presume it's something to do with the fingerprint scanner having a different hardware key/serial to the new one and retaining that info somewhere in the data partition when you back it up.
DanielF50 said:
Have you tried wiping data, setting up the device again, and then checking if you can add a fingerprint?
I tried restoring data from a device I had to RMA too, and got that exact message every time - I gave up in the end as I tried wiping everything but the only thing that worked was clearing userdata & restoring my apps from the nandroid via TiBu.
All in all, I presume it's something to do with the fingerprint scanner having a different hardware key/serial to the new one and retaining that info somewhere in the data partition when you back it up.
Click to expand...
Click to collapse
Yup I did try that, didn't work either. I'm right where you were too, currently restoring apps for TB. Your hypothesis seems plausible to me, I hadn't thought of that. Kind of a bummer for swapping devices if that is the case. I wonder if we could find where the fingerprint key is stored in userdata and back it up prior to flashing the nandroid?
Thanks for the reply!
No problems & yes, it is, though I presume it's either been done for some sort of security, or as a complete oversight - I can't see Google deliberately doing so, especially on a Nexus device.
I think it's probably highly likely that someone will find the hardware/serial file soon and find a way to stop it from being overwritten when TWRP restores the data partition, though it is annoying that it hasn't been discovered yet... Thankfully restoring from a nandroid through TitaniumBackup isn't too bad nowadays!
Srry for necro but I think I might have found a workaround solution to this problem or at least the problem which is very similar to this one. Please check "symptoms" in the description of the solution to make sure we are talking about the same issue.
Here's the link to the solution: http://forum.xda-developers.com/showpost.php?p=68374321&postcount=1446
erikem said:
Srry for necro but I think I might have found a workaround solution to this problem or at least the problem which is very similar to this one. Please check "symptoms" in the description of the solution to make sure we are talking about the same issue.
Here's the link to the solution: http://forum.xda-developers.com/showpost.php?p=68374321&postcount=1446
Click to expand...
Click to collapse
Sorry for another necro, but this doesn't work for me on Android 7.1.1
Edit: Correct fix here: https://forum.xda-developers.com/showpost.php?p=68199207&postcount=9

Encryption

Hello,
I recently decided to look into encrypting my Nexus 4 running stock 5.1.1, but have a few questions before doing so.
I have a handful of modifications, including custom kernel, root, and xposed. Would any of these prevent me from encrypting my device, or cause problems afterwards?
I am planning on making a full twrp backup prior to the process, but if I encounter a problem during the encrypting process or realize that encryption isn't for me , will I be able to simply restore my nandroid and my device will restore without issue?
In order to reverse encryption, does the device need to be factory reset, or will just a restore reverse the encryption? If I made a nandroid backup while my device is encrypted and tried to restore it after my device is no longer encrypted would it restore without a problem, or would it restore the encryption with it?
Sorry for all the questions, I just want to ensure my data stays protected during this process. Thanks in advance.
I would recommend not to do. Our N4 does not have hardware support for encryption so losing a little performance.
xim4 said:
I would recommend not to do. Our N4 does not have hardware support for encryption so losing a little performance.
Click to expand...
Click to collapse
Thank you for response. I went ahead and encrypted the device and I am not noticing any real world performance decrease. I don't play any games on my device, and use it for regular use. If I notice any issues, I will format and reactor my backup. Thanks again.

I screwed up and lost my data - any hope?

Hey guys,
I need quick help.
I was on DU Nougat and wanted to try RRemix. Didnt noticed this thing is encrypted, panicked when encryption started when booting up after clean flashing rr and shut down the phone in the mittle of the process.
No every time I enter twrp it asks for a pw to decrypt. when entering "default_password" it first displays unable to mount.. and then decrypting data.
When I first tried this I got into twrp and after booting up the system again, there was a message saying that encryption failed and that i can reset my phone now and will then have the opportunity to restore my data. when I press the "reset phone" button it brings me to the twrp menu where i enter the pw like above and the same thing starts again.
When in TWRP my sdcard shows empty.
Are there any options for me, or did I just lost all my phone data from months without a backup.
Thanks so much! Could cry right now...
xflowy said:
Hey guys,
I need quick help.
I was on DU Nougat and wanted to try RRemix. Didnt noticed this thing is encrypted, panicked when encryption started when booting up after clean flashing rr and shut down the phone in the mittle of the process.
No every time I enter twrp it asks for a pw to decrypt. when entering "default_password" it first displays unable to mount.. and then decrypting data.
When I first tried this I got into twrp and after booting up the system again, there was a message saying that encryption failed and that i can reset my phone now and will then have the opportunity to restore my data. when I press the "reset phone" button it brings me to the twrp menu where i enter the pw like above and the same thing starts again.
When in TWRP my sdcard shows empty.
Are there any options for me, or did I just lost all my phone data from months without a backup.
Thanks so much! Could cry right now...
Click to expand...
Click to collapse
Unfortunately that is true, that you might have lost your data. I had the same issue when i flashed 7.1.1 DP1 over 7.0 and forgot to patch the boot image.
Read my thread where I have explained couple of things I tried to do but I have not been able to get my data back. http://forum.xda-developers.com/nexus-6p/help/encryption-unsuccessful-data-t3493422
And since no one replied to my thread I presume there has been no successful case of data retrieval till now and there is no way we can get the data back.
TBH in my case I did not even know that it was encrypting the data because there was not visible cue just the google boot animation staying on for a long time than usual and hence my reason to suspect a bootloop and re-start the phone.
guess i should've named my thread "HELP ME". -.-
A safe creation of an encrypted volume usually starts by blanking the disk to avoid clear/encrypted differentiation to make cryptanalysis harder and to avoid exactly what you are trying to do. (Let's say the write speed being 160MBps it would take around 3 minutes to initialize the data crypto)
You could check by pulling the raw block /dev/mmcXX data partition on your PC and then use a tool to recover chunks from that file, like photorec on Linux.
Well, good luck. Always always have a backup...
rchtk said:
A safe creation of an encrypted volume usually starts by blanking the disk to avoid clear/encrypted differentiation to make cryptanalysis harder and to avoid exactly what you are trying to do. (Let's say the write speed being 160MBps it would take around 3 minutes to initialize the data crypto)
You could check by pulling the raw block /dev/mmcXX data partition on your PC and then use a tool to recover chunks from that file, like photorec on Linux.
Well, good luck. Always always have a backup...
Click to expand...
Click to collapse
Hello rchtk
Quick question, what do you mean by blanking the disk? What if the disk had data? I though encryption would still keep the data, only encrypt it with a key (pattern, key pin or password whichever).
prgopala said:
Hello rchtk
Quick question, what do you mean by blanking the disk? What if the disk had data? I though encryption would still keep the data, only encrypt it with a key (pattern, key pin or password whichever).
Click to expand...
Click to collapse
No, they are gone!
As far as I know:
In-place encryption (ie without loosing data) only happens when migrating from KitKat to Lollipop.
Otherwise starting on an unencrypted data disk with forceencrypt will trigger the encryption and that will create a ciphered volume: mainly preparing the partition with ciphering metadata and creating a filesystem in it (again an empty filesystem is only metadata spread at several places). That would still leave old data in between these metadata that you could recover, so I guess the old partition is filled with random before that.
There's also encryptable partition flag, which will trigger in-place (keeping data) when the user goes in settings->security>encryption>encrypt.
Changing pin code will not erase data as it doesn't change the encryption of the data but only the master key.

Selling my 6P, but can't seem to fully reset it, nor remove password from TWRP

Been working on this for a while now, but can't figure out how to get around it.
The phone is currently runing a custom 8.1.1 ROM and I have TWRP 3.2.0.0 installed.
I've done full wipes and factory resets, but the phone never seems to fully reset. I am fine with losing everything on the phone. I just want it 100% clean so I can sell it, which of course includes getting rid of the password on TWRP so the next user can mess around in there.
I have access to TWRP, the password is mine. But I can't seem to remove it, and every time I wipe and reset the phone it still asks me for my old device password with the owner message present as well.
I have also tried to format data, but it is unable to mount the data partition it seems, which I am guessing is due to encryption.
What's my fastest way to a reset and clean phone? I'm getting desperate here since I'm running out of time.
Edit: Through no change in process of my own, it suddenly completely reset. Now I'm more curious as to why.. Can anyone explain so I can avoid this issue in the future?
for me, the only way is to flash the full factory image from the Google site
First clear data and than flash software

Categories

Resources