Root and Security / Prevent Flash Recovery / Prevents to Decrypt Data - HTC 10 Questions & Answers

Hello.
I search for a way to hold my HTC 10 safe if someone sholud take my phone.
Actually i am able to read all my data over the TWRP, doesn't matter if i use the safest security things, like the phone goes back to facroty reset after to much wrong password tries.
No one should be able to Flash a recovery oder take my data out, actually you just need to flash TWRP to uncrypt the Data Partition.
Is there any way to make my phone with root really safe?
Does it affect something if the Option "Unlock OEM" in the Developer Settings ist checked or not?
Thank you

You have to go to Settings->Security->Screen lock
Here you select what you want (pattern, pin, password,..) and then enter yours security, then it will show another screen and just select "Require pattern to start device" and then re-enter security again.
Now after factory reset if someone wants to use the phone he/she will have to enter your gmail credential to use the phone... it will not work without google account. This is as much as we can do. Also you can flash stock recovery and disable USB debugging

CrazyCypher said:
You have to go to Settings->Security->Screen lock
Here you select what you want (pattern, pin, password,..) and then enter yours security, then it will show another screen and just select "Require pattern to start device" and then re-enter security again.
Now after factory reset if someone wants to use the phone he/she will have to enter your gmail credential to use the phone... it will not work without google account. This is as much as we can do. Also you can flash stock recovery and disable USB debugging
Click to expand...
Click to collapse
I guess though, if phone is stolen and you have twrp installed, your in trouble, if they know what they're doing. Cause your phone is decrypted once in recovery, afaik. If someone can correct me, I would like to know. Always assumed all bets are off once twrp installed.

purple patch said:
I guess though, if phone is stolen and you have twrp installed, your in trouble, if they know what they're doing. Cause your phone is decrypted once in recovery, afaik. If someone can correct me, I would like to know. Always assumed all bets are off once twrp installed.
Click to expand...
Click to collapse
Follow what I wrote in my previous post. If you do so, TWRP will ask you for security (pattern, pass, etc) to decrypt data otherwise it will not bi able to

CrazyCypher said:
Follow what I wrote in my previous post. If you do so, TWRP will ask you for security (pattern, pass, etc) to decrypt data otherwise it will not bi able to
Click to expand...
Click to collapse
Oh OK thanks. So when i use encrypted system but choose not to use a password to start phone as you mentioned, twrp is just using a default password to decrypt?

purple patch said:
Oh OK thanks. So when i use encrypted system but choose not to use a password to start phone as you mentioned, twrp is just using a default password to decrypt?
Click to expand...
Click to collapse
I think so, yes. If you correctly enabled security so it appears before phone turns on and also to be enabled in TWRP, you will every reboot get this window before you can use the phone:
http://www.androidcentral.com/sites...2/decrypt-screen-htc-one-a9.jpg?itok=56N6fDJE
I get this window, but I have pattern..this is picture from web

CrazyCypher said:
I think so, yes. If you correctly enabled security so it appears before phone turns on and also to be enabled in TWRP, you will every reboot get this window before you can use the phone:
http://www.androidcentral.com/sites...2/decrypt-screen-htc-one-a9.jpg?itok=56N6fDJE
I get this window, but I have pattern..this is picture from web
Click to expand...
Click to collapse
Yes, I've seen that before phone boots. But did not realise it stops you from decrypting in twrp. I have always been able to get in to twrp without pin/pattern. Now you mention though, wipe data in twrp was the only way to remove that security screen, so it's probably still encrypted until that is done. Thanks, makes sense now.

purple patch said:
Yes, I've seen that before phone boots. But did not realise it stops you from decrypting in twrp. I have always been able to get in to twrp without pin/pattern. Now you mention though, wipe data in twrp was the only way to remove that security screen, so it's probably still encrypted until that is done. Thanks, makes sense now.
Click to expand...
Click to collapse
Try to boot in TWRP... I am being asked to input pattern to decrypt data before I can enter TWRP... I wasn't always being asked, before I selected the setting in "Settings->Security->Screen lock" TWRP just said it decrypted data with default passowrd... now that I enabled in "Settings->Security->Screen lock", also TWRP ask me to input before it can decrypt.
ALSO be sure you have latest TWRP installed, previous version were not able to decrypt data no matter what setting you had.

CrazyCypher said:
You have to go to Settings->Security->Screen lock
Here you select what you want (pattern, pin, password,..) and then enter yours security, then it will show another screen and just select "Require pattern to start device" and then re-enter security again.
Now after factory reset if someone wants to use the phone he/she will have to enter your gmail credential to use the phone... it will not work without google account. This is as much as we can do. Also you can flash stock recovery and disable USB debugging
Click to expand...
Click to collapse
Thank you for this Information, if this is really safe it would be really nice.
I will try it as soon as possible after i backed my device up.
And it is still save, doesn't matter which TWRP version (or maybe other recovery) you will flash?
I like the idea to still use TWRP. Could it be still possible to have root with the strok recovery?
USB Debugging is still off since i got my device and i flashed it already back to stock recovery for the OTA and again to TWRP, i never enablet USB Debuging, i think this option does not affect anything?
Or do you mean i shold disable "OEM Unlock" or what will happen if you set disable to this option?

Nobody who steals a phone is too interested in your data unless that is the sole reason why they took your phone.
Sent from my HTC 10 using XDA-Developers mobile app

Thank you, it seems like it works if you choose "Require pattern to start device"
Actually i didn't try to flash, wipe, format or something else but i guess whatever you will do, its not possible to decript the internal storage again?
@Android The Greek.. yes this is the reason for this thread, because if you took a rooted phone, i guess you always will be able to flash them so that you can use it again?.. If its not rooted, you should not be able to use this phone again if you choose this security.

I actually got another question. What is if someone does flash another backup to system and more, but just let "data" stay.
Is the encryption still save and all the keys stored in the "data" partition or its possible to get access to data?

Related

Be warned: Encrypting your device can be dangerous

Hello,
As Google has decided to turn encryption on as a standard in the upcoming Android 5.0, I thought I would give it a test on my CosmicCM 5.4.
I started the encryption and it prompts you that you for a passcode that will be used from now on, so far no problem.
It started encrypting my device and it was running for some time(I left it alone for an hour) and reboots a couple of times.
After he's finished the annoyance came.
first you will have to type twice your password with a reboot, one time do decrypt your device the second time to enter your device.
Be aware that performance can be slowed through encryption, and it can negatively impact battery life too.
So I decide to go back.
The Problem: Once encrypted, you can't decrypt it easily.
When encrypting the phone android will tell you you can only decrypt it using a factory reset. Naturally you assume it's talking about the "Factory Data Reset" option found in Settings --> Backup and Reset and this works.
Now I wanted to try a rom (TW 4.2.2 based) and see how this worked and after installing and booting.
I got prompted to enter the decryption and of course this didn’t work anymore as there is no data for the password.
So I assumed you can wipe everything from your custom recovery mod (CWM, TWRP, or one of those).
Wrong! You'll get beautiful "can't mount /data" messages and more.
After some hard time I got everything working again, by flashing CosmicCM again.
The phone booted al clean again without asking for encryption and when you check the menu it also mentioned encryption is deactivated.
Trying the previous rom again just triggerd the encryption again.
So It seems that there is still somewhere a hidden encrypted protection that will be activated when I flash a different rom.
So be warned and don’t play with encrypting your device as you could brick it.
Didn't have time to investigate further on how I can remove it completely, but my guess is I have to redo all the partitions.
I was on the same boat a month ago
akiratoriyama said:
I was on the same boat a month ago
Click to expand...
Click to collapse
I wish you told me sooner
Did you redo all the partitions to get the encryption completely removed?
RichyE said:
I wish you told me sooner
Did you redo all the partitions to get the encryption completely removed?
Click to expand...
Click to collapse
I think I had to wipe my data via Philz, CWM and stock to remove encryption.
akiratoriyama said:
I think I had to wipe my data via Philz, CWM and stock to remove encryption.
Click to expand...
Click to collapse
Thanks for the info, will try to flash stock this week and see if this helps

Is my phone currently encrypted? [Pure Nexus ROM]

I have a Nexus 5x that I rooted. For a brief time, whenever I booted into TWRP, it would ask for my pin to decrypt the phone and access data. Now however, it does not. Under security settings, it still says the phone is encrypted. I'm not sure if it's still encrypted or not at this point, and I'm not sure what I might have done to disable the encryption. I used to have to enter a pin when I turn it on before it fully boots, like it wouldn't even get to my proper lock screen before I entered it. Now it'll boot to my lock screen, but if I try to use my finger print scanner to unlock it, it'll prompt me for my pin the first time.
Any advice on finding out if it's truly encrypted or not, and if not, how to renable the encryption? If there's any other info needed please let me know.
EDIT: Issue was solved by turning off Taskers accessibility service.
Boot into twrp. Does it ask for your pin? If so, encrypted. If not, unencrypted.
My phone is unencrypted and requires me to enter my password at the lockscreen on a cold boot. In pretty sure that is expected behavior.
Sent from my Nexus 5X using Tapatalk
PiousInquisitor said:
Boot into twrp. Does it ask for your pin? If so, encrypted. If not, unencrypted.
My phone is unencrypted and requires me to enter my password at the lockscreen on a cold boot. In pretty sure that is expected behavior.
Sent from my Nexus 5X using Tapatalk
Click to expand...
Click to collapse
It doesn't ask for my pin... but it does say it's encrypted under the security settings. How do I go about reactivating encryption this case? Any ideas? Thanks for the reply.
Flashing the stock boot image will then encrypt data on next boot.But I have no idea if your rom works with stock kernel.
Search your rom's thread
PiousInquisitor said:
Boot into twrp. Does it ask for your pin? If so, encrypted. If not, unencrypted.
My phone is unencrypted and requires me to enter my password at the lockscreen on a cold boot. In pretty sure that is expected behavior.
Sent from my Nexus 5X using Tapatalk
Click to expand...
Click to collapse
So the phone showing a status of "Encrypted" inside android security is inaccurate if we're on the PureNexus ROM?
IamFuzzles said:
I have a Nexus 5x that I rooted. For a brief time, whenever I booted into TWRP, it would ask for my pin to decrypt the phone and access data. Now however, it does not. Under security settings, it still says the phone is encrypted. I'm not sure if it's still encrypted or not at this point, and I'm not sure what I might have done to disable the encryption. I used to have to enter a pin when I turn it on before it fully boots, like it wouldn't even get to my proper lock screen before I entered it. Now it'll boot to my lock screen, but if I try to use my finger print scanner to unlock it, it'll prompt me for my pin the first time.
Any advice on finding out if it's truly encrypted or not, and if not, how to renable the encryption? If there's any other info needed please let me know.
Click to expand...
Click to collapse
I would guess that you are encrypted with the default password. If you change the password, TWRP would probably ask you for a PIN/password.
So I looked into it some more, and it seems that because I granted Tasker accessibility access, it prevented proper encryption. Turning off Taskers accessibility access fixed the issue. Thanks for the help all.

Question about unlocking the bootloader and password at the startup.

Hi
My Nexus 5X is arriving this week. I had many nexus devices before, but now I saw that you can add a password at the startup of the phone and I wanted to know how this is working with an unlocked bootloader.
In the Nexus 5 (2013) I used to keep my bootloader closed because with the bootloader open there was a risk: you were able to install (fastboot flash) or boot (fastboot boot) a CUSTOM recovery and flash things without wiping data, or even, access the internal memory of the phone from the custom bootloader. (This didn't happen with the locked bootloader because you were forced to wipe /data before flash a custom bootloader).
So now, with the 5X and the startup password, how does it works with an open bootloader? If I open the bootloader, the only way to flash anything is knowing the startup password? Or you can access fastboot mode without any password and good to go?
If that's the case, then I think I'll keep my bootloader locked!
I'm asking this prematurely because I don't want to install everything, and then wipe to open the bootloader, and start from scratch again.
Thanks
Sebastian!
thesebastian said:
Hi
My Nexus 5X is arriving this week. I had many nexus devices before, but now I saw that you can add a password at the startup of the phone and I wanted to know how this is working with an unlocked bootloader.
In the Nexus 5 (2013) I used to keep my bootloader closed because with the bootloader open there was a risk: you were able to install (fastboot flash) or boot (fastboot boot) a CUSTOM recovery and flash things without wiping data, or even, access the internal memory of the phone from the custom bootloader. (This didn't happen with the locked bootloader because you were forced to wipe /data before flash a custom bootloader).
So now, with the 5X and the startup password, how does it works with an open bootloader? If I open the bootloader, the only way to flash anything is knowing the startup password? Or you can access fastboot mode without any password and good to go?
If that's the case, then I think I'll keep my bootloader locked!
I'm asking this prematurely because I don't want to install everything, and then wipe to open the bootloader, and start from scratch again.
Thanks
Sebastian!
Click to expand...
Click to collapse
You can access without password.
Thanks Oblox. Then I think I'm keeping a locked bootloader for now!
I don't understand why they don't request a password to access the bootloader.... it could be much more secure.
Sent from my E5823
thesebastian said:
Thanks Oblox. Then I think I'm keeping a locked bootloader for now!
I don't understand why they don't request a password to access the bootloader.... it could be much more secure.
Sent from my E5823
Click to expand...
Click to collapse
Agreed in principal, security concerns raised by unlocking the bootloader would be much less of an issue if they allowed it to be password protected.
However id imagine it would cause headaches when flashing new bootloader (Where does the unlock info sit?) and when ADB'ing via usb etc that are too much effort to address. Id imagine most users dont ever unlock so dont suffer and 'developers' who do are suitably warned.
thesebastian said:
Hi
My Nexus 5X is arriving this week. I had many nexus devices before, but now I saw that you can add a password at the startup of the phone and I wanted to know how this is working with an unlocked bootloader.
In the Nexus 5 (2013) I used to keep my bootloader closed because with the bootloader open there was a risk: you were able to install (fastboot flash) or boot (fastboot boot) a CUSTOM recovery and flash things without wiping data, or even, access the internal memory of the phone from the custom bootloader. (This didn't happen with the locked bootloader because you were forced to wipe /data before flash a custom bootloader).
So now, with the 5X and the startup password, how does it works with an open bootloader? If I open the bootloader, the only way to flash anything is knowing the startup password? Or you can access fastboot mode without any password and good to go?
If that's the case, then I think I'll keep my bootloader locked!
I'm asking this prematurely because I don't want to install everything, and then wipe to open the bootloader, and start from scratch again.
Thanks
Sebastian!
Click to expand...
Click to collapse
It depends what you are trying to protect.
When you boot the phone it will pick some random key and encrypt your user partition, so your user partition is ALWAYS encrypted using a private randomly generated key.
Then if you don't select a pattern, pin, or password, that random key is (rather than being stored in plaintext) encrypted using the default string "password" plus some phone specific information accesible on the phone itself.
If you do select a pattern, pin, or password, then the random key is reencrypted with a process that includes your pattern, pin, or password.
In this way, when you change your pattern, pin, or password, the whole user partition does not need to be re-encrypted, just the random private key used to encrypt your user partition needs to be re-encrypted.
The password you enter upon startup is to unlock/decrypt the user partition.
So if you have unlocked bootloader, someone can steal your phone but can't get access to your data easily unless you leave the phone with no pattern, pin, or password.
They can overwrite your system and boot partitions, but if you have pattern, pin, or password when they try to factory reset your phone there is some Android factory reset protection that will ask them to enter your pattern, pin, or password when the phone connects to Google. This actually often locks users out of their own phones when they forget the pattern they used because it was just temporary when they entered it or it was an old pattern they used a long time ago and it comes back on factory restore.
The best they can hope for would be to install custom boot/system images and trick you into giving them your pattern, pin, or password, prior to stealing your phone.
So it really depends what you are trying to protect.
Locked bootloader, on the other hand, if you mess things up, can be a big impediment to fixing your phone.
My suggestion would be to unlock your bootloader, create a pattern/pin/password, and leave Nexus factory reset protection turned on.
Good flexibility with reasonable protection.
The password you enter at startup is so the kernel can finish the boot process, otherwise it cannot read your user partition.
You'd need to enter that password when running TWRP custom recovery as well or it won't be able to read your user partition.
thesebastian said:
Hi
My Nexus 5X is arriving this week. I had many nexus devices before, but now I saw that you can add a password at the startup of the phone and I wanted to know how this is working with an unlocked bootloader.
In the Nexus 5 (2013) I used to keep my bootloader closed because with the bootloader open there was a risk: you were able to install (fastboot flash) or boot (fastboot boot) a CUSTOM recovery and flash things without wiping data, or even, access the internal memory of the phone from the custom bootloader. (This didn't happen with the locked bootloader because you were forced to wipe /data before flash a custom bootloader).
So now, with the 5X and the startup password, how does it works with an open bootloader? If I open the bootloader, the only way to flash anything is knowing the startup password? Or you can access fastboot mode without any password and good to go?
If that's the case, then I think I'll keep my bootloader locked!
I'm asking this prematurely because I don't want to install everything, and then wipe to open the bootloader, and start from scratch again.
Thanks
Sebastian!
Click to expand...
Click to collapse
Just one thing to add onto the words of everyone else. This is my first Nexus but it is my understanding that previous Nexus devices have allowed users to lock/unlock the bootloader on the fly via an app. If this is something you intend to do, you should be aware that does not exist on the 5X. The bootloader must be unlocked after enabling OEM Unlock in Developer Settings. You can now install sideload OTAs from Google's website though.
Sent from my Nexus 5X using Tapatalk
Thanks you very much for all your posts.
I think I'll stay with a locked bootloader for now. At the end of my N5 2013 life I wasn't really using root features. Later I spent too much time with a Z5 Compact where opening a bootloader has bad consequences. So now I'm pretty much used to closed bootloaders.
So considering that fast boot and recovery mode don't need the startup PIN I'll stay with a locked bootloader.
However I already got a reason to unlock the bootloader. If there's any way to record videos in [email protected] I'd root the phone.
Sent from my Nexus 5X
I think sfhub said that you'd need a password to boot into the recovery as well. So unlocking your bootloader and leaving the phone encrypted with rest of the security features turned on does seem quite secure than i initially imagined. Too bad I never stayed encrypted long enough to play around with these.
But does it still ask for a password if you flash a different/custom recovery? I'm guessing it will, assuming the passwords are located on /data partition which is encrypted.
That said, someone in PN thread mentioned that knowledgeable hackers can still gain access to an unlocked, but encrypted phone via methods I'm unaware of. But I'd say it is very unlikely that my phone will end up in the hands of someone with such abilities.
The conversation is here: http://forum.xda-developers.com/nex...nexus-layers-fi-wifi-calling-t3244601/page351
roofrider said:
I think sfhub said that you'd need a password to boot into the recovery as well. So unlocking your bootloader and leaving the phone encrypted with rest of the security features turned on does seem quite secure than i initially imagined.
Click to expand...
Click to collapse
You don't need a password to boot into Recovery. You need to enter a pattern/PIN/password into TWRP (TWRP's UI is the one presenting the UI to ask for your password) to allow TWRP to mount your user partition as without that information the user partition is just gibberish.
roofrider said:
But does it still ask for a password if you flash a different/custom recovery? I'm guessing it will, assuming the passwords are located on /data partition which is encrypted.
Click to expand...
Click to collapse
Whether the different custom recovery asks you a password or not will depend on the custom recovery, but if your recovery doesn't ask for a password, then that recovery has no ability to access your user partition as it won't be able to decrypt the contents. Even if it does ask for a password, sometimes it can't access due to mismatch in decryption procedures. Some earlier versions of TWRP had this problem.
roofrider said:
That said, someone in PN thread mentioned that knowledgeable hackers can still gain access to an unlocked, but encrypted phone via methods I'm unaware of. But I'd say it is very unlikely that my phone will end up in the hands of someone with such abilities.
Click to expand...
Click to collapse
If you leave your bootloader unlocked (especially if a bad actor has physical access to your phone), if someone is determined enough they can eventually get access, but with current features it is significantly more difficult/annoying (compared to how trivial it was prior to encryption) to the point most normal people won't bother:
1) AES encrypted user partition
2) multiple password failure reset
3) mixing your pattern/PIN/password with phone specific salt
4) factory reset protection
5) remote reset
The easiest way for them to get access to your phone is to install a custom android or recovery that records your pattern/PIN/password and getting you to enter that information on your own, prior to stealing your phone.
I am guessing multiple password failure reset can be bypassed with bootloader unlocked, so brute force is likely easier.
Now if someone comes out with tools to automate brute force of phones with bootloader unlocked then you might only have real protection from brute force if you enter a complex password rather than pattern/PIN. This still wouldn't protect you from having someone replace your recovery or OS with something that records your pattern/PIN/password but it would protect against the most likely case of someone stealing your phone and trying to access your user data.
I have another question
Can you open the bootloader if the phone is encrypted and with startup pin/password?
If so (I assume yes) /data is wiped and then the phones encryption is reserved? (Just like out of the box)
Sent from my Nexus 5X
thesebastian said:
I have another question
Can you open the bootloader if the phone is encrypted and with startup pin/password?
If so (I assume yes) /data is wiped and then the phones encryption is reserved? (Just like out of the box)
Click to expand...
Click to collapse
I assume you mean "unlock" the bootloader.
The answer is yes and no.
You must first go into developer options to allow OEM unlocking.
If you have a locked bootloader and set up a pattern/PIN/password, then for somebody else (w/o your pattern/PIN/password) to enable OEM unlocking would prove to be a challenge since they can't easily get past your Android login and I haven't an easy way for them to enable it through other means.
Assuming they can get past your pattern/PIN/password (or you just left OEM unlocking enabled yourself) then yes, they can unlock the bootloader and it will enforce a data wipe in the process.
Android factory reset protection might also kick in after the phone connects to Google and they may be forced to enter your pattern/PIN/password to access your system.
I don't know what you mean by "encryption is preserved" The user partition starts off unencrypted. Upon first boot, the kernel will see it isn't encrypted and will encrypt it. From that point on the user partition is always encrypted.
If your data gets wiped due to bootloader unlock, the user partition will be erased, reformatted (at which point it'll be briefly unencrypted), then will be re-encrypted upon first boot of kernel.
sfhub said:
I assume you mean "unlock" the bootloader.
The answer is yes and no.
You must first go into developer options to allow OEM unlocking.
If you have a locked bootloader and set up a pattern/PIN/password, then for somebody else (w/o your pattern/PIN/password) to enable OEM unlocking would prove to be a challenge since they can't easily get past your Android login and I haven't an easy way for them to enable it through other means.
Assuming they can get past your pattern/PIN/password (or you just left OEM unlocking enabled yourself) then yes, they can unlock the bootloader and it will enforce a data wipe in the process.
Android factory reset protection might also kick in after the phone connects to Google and they may be forced to enter your pattern/PIN/password to access your system.
Click to expand...
Click to collapse
Oh yes sorry! I totally forgot about that option under dev settings when I asked the question. So fastboot oem unlock will never work without knowing my PIN (I never had this the Nexus 5 and older Nexus).
That means that a Nexus 5X with a locked bootloader and that option disabled is completely useless for a thief? (Without including advanced concepts like "change the internal memory") Or you can still rewrite /data with a locked bootloader and get rid of the encryption?
(This applies also for the stock recovery "wipe data" function?)
These last questions I've made are not about privacy, are more about anti-theft features.
Sent from my Nexus 5X
thesebastian said:
Oh yes sorry! I totally forgot about that option under dev settings when I asked the question. So fastboot oem unlock will never work without knowing my PIN! (I never had this the Nexus 5 and older Nexus).
That means that a Nexus 5X with a locked bootloader and that option disabled is completely useless for a thief? Or you can still rewrite data with a locked bootloader and get rid of the encryption?
Click to expand...
Click to collapse
I think "useless" is in the eye of the beholder.
IMO with locked bootloader, OEM unlock disabled, pattern/PIN/password created, standard encryption enforced, it would be extremely difficult to access your data.
They could boot into recovery and reset your user partition, but in that case, they wouldn't be accessing your data and upon connection to google will likely get hit with android factory reset protection and need to enter your pattern/PIN/password to access the phone.
They may be able to force LG recovery mode and rewrite your phone. I don't know what happens with Android factory reset protection in this case, but they won't be accessing your user data unless they can easily break AES-256 brute force (which is not really possible today unless your keys get compromised through social engineering)
I think worse case, with a bunch of work, they might have a functioning phone that will lock them out if they ever connect to a network. They can probably sideload some games and use it for that.
---------- Post added at 12:24 PM ---------- Previous post was at 12:08 PM ----------
One other thing, keep in mind this is how things are designed to work with all the chains being secure (bootloader, kernel, recovery, android, etc.)
There could always be some zero day bug that could be exploited to break the design. If there was a kernel memory overrun bug that wasn't patched, that could potentiall be exploited to replace the code that resets the phone upon too many mistaken password entries, and then that combined with a 4 digit PIN code might result in a brute force attack on your PIN being feasible, there are only 10,000 combinations to try.
That is similar to what happen with the San Bernardino iPhone case. They were able to disable the phone reset after incorrect PIN entry functionality then just brute force the PIN.
sfhub said:
I think "useless" is in the eye of the beholder.
IMO with locked bootloader, OEM unlock disabled, pattern/PIN/password created, standard encryption enforced, it would be extremely difficult to access your data.
They could boot into recovery and reset your user partition, but in that case, they wouldn't be accessing your data and upon connection to google will likely get hit with android factory reset protection and need to enter your pattern/PIN/password to access the phone.
They may be able to force LG recovery mode and rewrite your phone. I don't know what happens with Android factory reset protection in this case, but they won't be accessing your user data unless they can easily break AES-256 brute force (which is not really possible today unless your keys get compromised through social engineering)
I think worse case, with a bunch of work, they might have a functioning phone that will lock them out if they ever connect to a network. They can probably sideload some games and use it for that.
Click to expand...
Click to collapse
So if a thief get my phone and do a wipe data in the stock recovery. The phone is still encrypted? They can't add a new Google account and use it like an out of box Nexus?
I'm not concerned about privacy anymore (encryption seems to be good enough). Now I'm asking about how this device is protected against the black market
Sent from my Nexus 5X
Regarding privacy in Android N I just read this article that adds more (future) information to the topic:
http://m.androidcentral.com/how-android-n-addresses-security
Sent from my Nexus 5X
thesebastian said:
So if a thief get my phone and do a wipe data in the stock recovery. The phone is still encrypted? They can't add a new Google account and use it like an out of box Nexus?
I'm not concerned about privacy anymore (encryption seems to be good enough). Now I'm asking about how this device is protected against the black market
Click to expand...
Click to collapse
IIRC they may be able to factory reset using stock recovery (or Google could have enhanced stock recovery to ask for pattern/PIN/password as well) but upon connection to Google it'll reinstall pattern/PIN/password.
So they can probably get the phone to be usable until they connect to Internet at which point it isn't usable. How usable your phone is without a network connection is debatable.
If Google has enhanced recovery to ask for pattern/PIN/password then they couldn't even get that far, unless they somehow force LG recovery mode and use LGUP to overwrite the phone.
I would test this all out for you but I don't have a phone I can spare being used as a test right now.
sfhub said:
IIRC they may be able to factory reset using stock recovery (or Google could have enhanced stock recovery to ask for pattern/PIN/password as well) but upon connection to Google it'll reinstall pattern/PIN/password.
So they can probably get the phone to be usable until they connect to Internet at which point it isn't usable. How usable your phone is without a network connection is debatable.
If Google has enhanced recovery to ask for pattern/PIN/password then they couldn't even get that far, unless they somehow force LG recovery mode and use LGUP to overwrite the phone.
I would test this all out for you but I don't have a phone I can spare being used as a test right now.
Click to expand...
Click to collapse
No problem! Thanks for the answer. Really helpful.
This is also useful in case I wanted to buy a used Nexus phone. (Well I bought mine directly from "Amazon Warehouse deals" but I could had used Wallapop who knows!)
I assume that a Factory Reset made by the legit owner from the "Settings" menu and not from the "Recovery" is enough to make the Nexus "tradable" again.
Sent from my Nexus 5X
thesebastian said:
No problem! Thanks for the answer. Really helpful.
This is also useful in case I wanted to buy a used Nexus phone. (Well I bought mine directly from "Amazon Warehouse deals" but I could had used Wallapop who knows!)
I assume that a Factory Reset made by the legit owner from the "Settings" menu and not from the "Recovery" is enough to make the Nexus "tradable" again.
Click to expand...
Click to collapse
Ok, I think you jogged my memory.
I believe what happens is this.
When you tie a Google account to your phone, it sets some information in the UEFI bios storage area (or some other area that survives factory reset). When you factory reset from recovery, during the initial setup it'll force you to connect to the most recent account associated with the phone (normally upon initial boot, it won't force connection of Google account)
This tends to hit buyers of used phones when the seller factory resets their phone right before selling it without removing pattern/PIN/password and removing google accounts.
So the proper way to sell a phone is
1) remove pattern/PIN/password
2) remove all Google accounts associated with this device
3) factory reset phone
Every manufacturer might have slightly different factory reset protection routines. I believe some states passed laws that required devices have ability to be remotely locked in case stolen and all this is part of that infrastructure. You can look at that as government wanting control over locking your phone or government trying to reduce the value of stolen phones for your benefit.
I think even Factory Reset from settings can experience the problem of new buyer needing to connect to previous google account, so best to remove pattern/PIN/password and Google accounts. I believe just removing the pattern/PIN/password will remove factory reset protection and similarly removing Google account will to, but I am not absolutely sure, so best to remove both.
I know you asked from standpoint of buyer and I responded from standpoint of seller. If you purchased a used phone, you should remind the seller to do the proper steps to disable the factory reset protection. I think factory reset protection started in in devices that were pre-installed with 5.1 or higher.
If folks forget to remove factory reset protection, they'll need to contact the buyer and give them their Google account password so they can complete set up and un-associate the account from the phone. Also don't reset your Google password then give the other user the temporary password, hoping to then reset your Google password back to standard, because there is some freeze I think 24 or 72hours where you can't use the account for initial setup if your password just got changed.
@ sfhub It seems to be much more complex now. I have to sell my previous phone (Xperia Z5 Compact, shipped with lollipop, but not encrypted out of the box) one of these days. And I plan to sell this (amazing) Nexus 5X as soon as there is a new 2016 Nexus (specially if it's a bit smaller). So the tips are really welcome. Thanks
sfhub said:
Also don't reset your Google password then give the other user the temporary password, hoping to then reset your Google password back to standard, because there is some freeze I think 24 or 72hours where you can't use the account for initial setup if your password just got changed.
Click to expand...
Click to collapse
I asked a friend who went through this trauma and he confirmed that if you change your Google password, there is a 72hour (not 24hour) lock before that password can be used to unlock a phone that has been factory reset.
Further, everytime you enter the wrong Google account/password on the phone the 72hr timer is reset.
So if you are in this situation best to just let the 72hr cooldown period pass before attempting to get into the phone. Spend your initial time making sure you have the correct Google account and password that was associated with the phone in question, then just wait it out.

Questions about encryption of an unlocked OP3

Hey Guys,
When I got my OP3 I unlocked the bootloader right away and installed FreedomOS to get rid of the bloatware. As this is my first device, which comes with a locked bootloader and decryption, I have some questions about this topic. I was wondering that the encryption does not make any sense when you unlock your bootloader, because if somebody steals your phone, he can just enter twrp and access all your data. Then I flashed CM and after that TWRP was asking me to set a pin or pattern to lock my phone. Now I've to unlock my phone every time I want to enter the recovery or boot the system with a pattern, which is great, because now the encryption is not worthless anymore. Now I'm asking myself if this feature is somehow integrated into CM or was it just random that I found this feature? Is there any way to get this also with OOS installed? What things do I have to note to not accidentally make my phone unencryptable with the pattern? Is this even possible, maybe by flashing a new recovery or so?
Thanks in advance
Gerrit507 said:
Hey Guys,
When I got my OP3 I unlocked the bootloader right away and installed FreedomOS to get rid of the bloatware. As this is my first device, which comes with a locked bootloader and decryption, I have some questions about this topic. I was wondering that the encryption does not make any sense when you unlock your bootloader, because if somebody steals your phone, he can just enter twrp and access all your data. Then I flashed CM and after that TWRP was asking me to set a pin or pattern to lock my phone. Now I've to unlock my phone every time I want to enter the recovery or boot the system with a pattern, which is great, because now the encryption is not worthless anymore. Now I'm asking myself if this feature is somehow integrated into CM or was it just random that I found this feature? Is there any way to get this also with OOS installed? What things do I have to note to not accidentally make my phone unencryptable with the pattern? Is this even possible, maybe by flashing a new recovery or so?
Thanks in advance
Click to expand...
Click to collapse
If your phone is encrypted, TWRP has to prompt you to decrypt the /data partition before it can be mounted. This isn't a CM feature, it should act like this with any ROM if phone encryption is enabled. I've flashed most every rom and version of twrp in this forum and they all seem to work fine with the encryption enabled. I have not flashed multiboot yet as that requires your phone to be completely unencrypted. Not sure if that answers your question.
If security is your concern though, I would recommend switching to a passphrase instead of pattern for encryption unless your pattern is very long and complex. I recommend a passphrase of at least 16 characters.
kennonk said:
If your phone is encrypted, TWRP has to prompt you to decrypt the /data partition before it can be mounted. This isn't a CM feature, it should act like this with any ROM if phone encryption is enabled. I've flashed most every rom and version of twrp in this forum and they all seem to work fine with the encryption enabled. I have not flashed multiboot yet as that requires your phone to be completely unencrypted. Not sure if that answers your question.
If security is your concern though, I would recommend switching to a passphrase instead of pattern for encryption unless your pattern is very long and complex. I recommend a passphrase of at least 16 characters.
Click to expand...
Click to collapse
Ok I see, than I was getting something wrong there, thank you. The thing is FreedomOS stated that the phone is encrypted but I was never asked for the pattern by TWRP...
Gerrit507 said:
Ok I see, than I was getting something wrong there, thank you. The thing is FreedomOS stated that the phone is encrypted but I was never asked for the pattern by TWRP...
Click to expand...
Click to collapse
When you first booted up your stock phone and went through setup it asks if you want to secure the phone using pin/pattern/passphrase. I think that is where it is created then that key is written somewhere, not on the data or system partitions because is persists between wipes, and that is where TWRP and all future roms are authenticating you.
kennonk said:
When you first booted up your stock phone and went through setup it asks if you want to secure the phone using pin/pattern/passphrase. I think that is where it is created then that key is written somewhere, not on the data or system partitions because is persists between wipes, and that is where TWRP and all future roms are authenticating you.
Click to expand...
Click to collapse
Ok, I can not remember this... Then I guess the phone just stated it was encrypted and wasn't... And how can I change this pattern or unencrypt the phone?
Gerrit507 said:
Ok, I can not remember this... Then I guess the phone just stated it was encrypted and wasn't... And how can I change this pattern or unencrypt the phone?
Click to expand...
Click to collapse
Here is how to decrypt without losing data. http://forum.xda-developers.com/oneplus-3/how-to/unencrypt-oxygenos-loosing-data-t3412228
There is another article I think I saw it on the OnePlus forums about how to decrypt and wipe which will let you change the passphrase I think.
Basically if you decrypt, then flash Oxygen or Hydrogen without SuperSU it will force you to re-encrypt. At least that is my understanding as I haven't decrypted yet.
Good luck
kennonk said:
Here is how to decrypt without losing data. http://forum.xda-developers.com/oneplus-3/how-to/unencrypt-oxygenos-loosing-data-t3412228
There is another article I think I saw it on the OnePlus forums about how to decrypt and wipe which will let you change the passphrase I think.
Basically if you decrypt, then flash Oxygen or Hydrogen without SuperSU it will force you to re-encrypt. At least that is my understanding as I haven't decrypted yet.
Good luck
Click to expand...
Click to collapse
As far as I understood it, it's all about wiping userdata, which I did before flashing Freedom OS. This might explain why I had no encryption... Still strange that it did not prompt me again to set a new one...
edit: FreedomOS has supersu, but systemless... I also flashed supersu right after CM which is even more strange...
Gerrit507 said:
As far as I understood it, it's all about wiping userdata, which I did before flashing Freedom OS. This might explain why I had no encryption... Still strange that it did not prompt me again to set a new one...
Click to expand...
Click to collapse
Yeah I have wiped userdata and system and clean reflashed like 20-30 times in the last few weeks and I've never been prompted to recreate the initial passphrase I set for encryption.
kennonk said:
Yeah I have wiped userdata and system and clean reflashed like 20-30 times in the last few weeks and I've never been prompted to recreate the initial passphrase I set for encryption.
Click to expand...
Click to collapse
But I never had to decrypt in TWRP... It's mysterious As far as I understand the guide he just wipes userdata and the encryption is gone... Is there somebody who knows for sure where the key is located actually?
edit: Seems like the encryption key is coupled to your password
When a user elects to change or remove their password in settings, the UI sends the command cryptfs changepw to vold, and vold re-encrypts the disk master key with the new password.
Click to expand...
Click to collapse
https://source.android.com/security/encryption/
I can confirm that. I changed my pattern and unlocked the phone with it at booting.
If I remove my password it still says "encrypted" in security but I don't have to enter any pattern at boot.
Mine says "Encrypted" under Settings > Security & Fingerprint > Encryption but I can boot into TWRP and browse the entire file system without ever entering my pin code.
dcdruck1117 said:
Mine says "Encrypted" under Settings > Security & Fingerprint > Encryption but I can boot into TWRP and browse the entire file system without ever entering my pin code.
Click to expand...
Click to collapse
Sounds like you have the same issue like I had. It seems to me like an issue in OOS.
This is awesome. I thought rooting and unlocking the bootloader to install custom ROMs would need the phone to be decrypted -- great, great news!
So without knowing the passphrase a possible attacker can't get to the data even when the bootloader is unlocked and OS rooted?
kanttii said:
This is awesome. I thought rooting and unlocking the bootloader to install custom ROMs would need the phone to be decrypted -- great, great news!
So without knowing the passphrase a possible attacker can't get to the data even when the bootloader is unlocked and OS rooted?
Click to expand...
Click to collapse
Yes, all your data is being decrypted after your enter the passphrase.
Does anyone have any idea how I can encrypt my phone if it already says Settings > Security & fingerprint > Encryption > Encrypt phone = "Encrypted"? It's clearly not actually encrypted because I do not have to enter any pin to boot or read data in TWRP.
dcdruck1117 said:
Does anyone have any idea how I can encrypt my phone if it already says Settings > Security & fingerprint > Encryption > Encrypt phone = "Encrypted"? It's clearly not actually encrypted because I do not have to enter any pin to boot or read data in TWRP.
Click to expand...
Click to collapse
Go to lock screen settings and set it up again. You will be prompted if you want to enter pin every reboot.
proag said:
Go to lock screen settings and set it up again. You will be prompted if you want to enter pin every reboot.
Click to expand...
Click to collapse
Hey, thanks! The "require PIN to start device" screen doesn't make any mention of encryption, so I was under the impression that it was far more basic and wasn't at all related to encryption. I tried it though and now TWRP does ask me to decrypt my data partition, so it does work. Thanks for the assist!
been following this thread and i had a quick questions - so it looks like if you unlock BL and run a custom ROM, you can still have the security of encryption, but does this ONLY apply to the USERDATA partition?
for example, could someone launch TWRP recovery on your phone and flash something into the SYSTEM partition without ever touching your userdata partition (ie, a keylogger or malware)?
It seems to me that only the data partition is encrypted, but someone correct me if I'm wrong. I looked at the Android full disk encryption page and I only see mentions of the data partition.
dcdruck1117 said:
It seems to me that only the data partition is encrypted, but someone correct me if I'm wrong. I looked at the Android full disk encryption page and I only see mentions of the data partition.
Click to expand...
Click to collapse
so system is never encrypted? i guess at that point the stock recovery stops you from flashing malware but \TWRP wont
dcdruck1117 said:
It seems to me that only the data partition is encrypted, but someone correct me if I'm wrong. I looked at the Android full disk encryption page and I only see mentions of the data partition.
Click to expand...
Click to collapse
Your internal storage is mounted into your data partition actually. I think this means it's also encrypted.
2x4 said:
so system is never encrypted? i guess at that point the stock recovery stops you from flashing malware but \TWRP wont
Click to expand...
Click to collapse
I see no reason behind encrypting system, it's used read-only anyway as long as you don't flash something to it.
edit: Ah I see now what you mean. But if you have stock recovery you can also simply flash twrp over it or flash something to system via adb... I don't know if it would even be possible technically to encrypt system. Anyway I think the only solution would be to lock the bootloader I think. I don't know what actually happens if you lock your bootloader again while on twrp and custom rom, might brick your device

How to tell if I'm encrypted?

Just got a new HTC 10 a few weeks ago, updated to Nougat, factory wiped, flashed Elemental X kernel, then went about setting up the phone. I'm coming from a Nexus 6P where in the Security settings, it shows if the phone is encrypted or not. I do not see the same encryption status in the HTC 10's security settings. How can I see if my HTC 10 is encrypted or not?
tibere86 said:
Just got a new HTC 10 a few weeks ago, updated to Nougat, factory wiped, flashed Elemental X kernel, then went about setting up the phone. I'm coming from a Nexus 6P where in the Security settings, it shows if the phone is encrypted or not. I do not see the same encryption status in the HTC 10's security settings. How can I see if my HTC 10 is encrypted or not?
Click to expand...
Click to collapse
Have you flashed a custom rom? Or are you on stock nougat?
tibere86 said:
Just got a new HTC 10 a few weeks ago, updated to Nougat, factory wiped, flashed Elemental X kernel, then went about setting up the phone. I'm coming from a Nexus 6P where in the Security settings, it shows if the phone is encrypted or not. I do not see the same encryption status in the HTC 10's security settings. How can I see if my HTC 10 is encrypted or not?
Click to expand...
Click to collapse
When you boot your phone, does it ask for a password to decrypt? Or another way to tell is to boot to recovery. If encrcrypted, it'll prompt you for a password (don't enter one, just select cancel if it does ~ PW will not work here)
Go to settings, then click on storage, then click on phone storage, and scroll to the bottom, if it is checked you are encrypted. Don't listen to canadians they are evil.
rwallhtc said:
Have you flashed a custom rom? Or are you on stock nougat?
Click to expand...
Click to collapse
I'm on stock Nougat with Elemental X kernel.
xunholyx said:
When you boot your phone, does it ask for a password to decrypt? Or another way to tell is to boot to recovery. If encrcrypted, it'll prompt you for a password (don't enter one, just select cancel if it does ~ PW will not work here)
Click to expand...
Click to collapse
Nope, it doesn't ask me for a password. So looks like I'm decrypted :good:
Mikee4fun said:
Go to settings, then click on storage, then click on phone storage, and scroll to the bottom, if it is checked you are encrypted. Don't listen to canadians they are evil.
Click to expand...
Click to collapse
Awesome. Thanks for the answer. Just checked and the check box is greyed out which I assume means I'm decrypted :good:
tibere86 said:
I'm on stock Nougat with Elemental X kernel.
Nope, it doesn't ask me for a password. So looks like I'm decrypted :good:
Awesome. Thanks for the answer. Just checked and the check box is greyed out which I assume means I'm decrypted :good:
Click to expand...
Click to collapse
If you are on stock nougat then you will be encrypted. All stock roms like yours have force encryption enabled. It is an added feature to have a non-encrypted data partition. You will only be de-crypted if you choose that as an option whilst flashing a custom rom.
If the option is greyed out then this would mean to me that you don't have a choice. This would follow the assertion that force encryption is enabled. That would mean it is encrypted as I stated. Mine which is de-crypted looks like this. I chose the option when flashing my custom rom to not have an encrypted partition.
rwallhtc said:
If you are on stock nougat then you will be encrypted. All stock roms like yours have force encryption enabled. It is an added feature to have a non-encrypted data partition. You will only be de-crypted if you choose that as an option whilst flashing a custom rom.
If the option is greyed out then this would mean to me that you don't have a choice. This would follow the assertion that force encryption is enabled. That would mean it is encrypted as I stated. Mine which is de-crypted looks like this. I chose the option when flashing my custom rom to not have an encrypted partition.
Click to expand...
Click to collapse
Correct. Mine is grayed out and selected. Encrypted.
.
Aurelius99 said:
Correct. Mine is grayed out and selected. Encrypted.
.
Click to expand...
Click to collapse
Absolutely. No doubt about it. If you wish to have an un-encrypted data partition then you need to flash a custom rom and choose the option to have it un-encryped. That said our friends who make twrp (a custom recovery) are on the job working on decryption when using twrp. They even have a test version out which they call "hacky" which can handle an encrypted partitions. That said my feeling is this doesn't matter to you in the slightest.
If you found my post helpful click thanks.
rwallhtc said:
If you are on stock nougat then you will be encrypted. All stock roms like yours have force encryption enabled. It is an added feature to have a non-encrypted data partition. You will only be de-crypted if you choose that as an option whilst flashing a custom rom.
If the option is greyed out then this would mean to me that you don't have a choice. This would follow the assertion that force encryption is enabled. That would mean it is encrypted as I stated. Mine which is de-crypted looks like this. I chose the option when flashing my custom rom to not have an encrypted partition.
Click to expand...
Click to collapse
Yep. Noticed that. I ended up booting into TWRP, formating data partition, and rebooted into the OS, and the encryption check box is now unchecked
To determine whether your phone is encrypted or decrypted, you can follow these steps:
On Android devices:
1. Open the "Settings" app on your Android device.
2. Scroll down and tap on "Security" or "Security & privacy."
3. Look for an option called "Encryption" or "Encryption & credentials" and tap on it.
4. If your device is encrypted, you will see a message indicating that the device is encrypted. It may also display additional information about the encryption status.
If you don't find the "Encryption" or "Encryption & credentials" option in the settings, it's likely that your device is not encrypted.
On iOS devices (iPhone):
1. Open the "Settings" app on your iPhone.
2. Tap on "Touch ID & Passcode" or "Face ID & Passcode" (depending on your iPhone model).
3. Enter your device passcode if prompted.
4. Scroll down to the bottom of the screen.
5. If your iPhone is encrypted, you will see a message that says "Data protection is enabled" or "This iPhone is encrypted."
If you don't find any mention of data protection or encryption on the passcode settings screen, it indicates that your iPhone is not encrypted.
Note that encryption is an optional security feature, and not all devices may have it enabled by default. Additionally, the exact location of the encryption settings may vary slightly depending on the device manufacturer and Android/iOS version. If you're unable to locate the encryption settings, you can refer to your device's user manual or perform a web search specific to your device model and software version to find the exact instructions.

Categories

Resources