-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decryption unsuccessful on N5 running Stock 6.0 with ElementalX 6.03 #14
Comments
|
This exactly happens to me right now, using a CM13 (6.0) nightly build on my Oneplus One and the vdc command (which afaik the cryptfs-password UI is using under the hood). |
|
Android 6.0 uses a plain string, so no need to convert to hex. You can check if the password is set correctly with |
|
I see. But I tried that scenario and it doesn't work (for me). Maybe a CM13 bug - but I'd like to have a second experience backing that up. |
|
I'm running CyanogenMod 13 on my Nexus 6P (cm-13.0-20151213-NIGHTLY-angler), here's what I found: Changing the encryption password with It seems like So, I tried passing the default password: Which seems to have worked! Note that it doesn't seem to matter what value you pass as the current password - I passed the default password, but passing anything seems to work. Android and TWRP 2.8.7.2 now decrypt properly with |
|
Thanks! That's interesting, could be a change in 6.0.1, as it works without the current password in 6.0. I'll checkout the latest AOSP source and confirm. |
|
This seems to be a CM modification, the change is not in AOSP (as of android-6.0.1_r3). |
|
You're right - compare Seems to have been introduced with this commit: |
|
I don't quite see why they need the |
|
I'm not clear on it either, especially since it doesn't seem to be enforced (at least not via These are early nightlies, though - unstable by definition. So far, these CM13 nightlies have given me far less trouble than the first CM12 nightlies. |
|
Using I'm taken back that |
|
Just tried a default encryption without pin, pattern or password set unlocking with TWRP 2.8.7.0 and both https://github.com/CyanogenMod/android_system_vold/blob/cm-13.0/cryptfs.c#L82-L83 with no luck. |
|
Sounds like CM broke something again. |
|
@damaestro It would be interesting to know what happens if you use the screen lock pin instead of "default_password" here:
|
|
@damaestro Because it doesn't make sense to use the default_password as old password if you actually have configured a screen lock pin as device encryption password. I've read the cryptfs code a bit and it does pass the old password to the hardware. |
|
I was able to change the password with the following command : The OldPassword can actually be anything. And ALWAYS check with 'vdc cryptfs verifypw NewPassword' before rebooting :) |
|
Forgot to mention that this was on nexus 4 cm13 nightly from 2016-1-1 |
|
@xor-freenet Unfortunately, enabling encryption does not work when lock screen security is enabled (next boot fails with PIN, pattern and password set). Definitely a bug in CM 13 as everything worked in 12.1. However, I found this method and still managed to lock myself out of my device and wanted to report findings. My test was:
@lithorus how did you initially setup the encryption? I did |
|
@damaestro |
|
I'll try again with a fresh install from the latest nightly. |
|
Hi i can confirm the bug in latest nightly of cm13 on a nexus 5 (hammerheadcaf). I used '''vdc cryptfs changepw password ''' and i'm pretty sure i'm typing it in correctly. Nevertheless it won't decrypt saying "wrong password". Any idea how to decrypt the phone (despite a reset - of course)? |
|
Seems to be fixed in the latest nightly (20160109). I changed lockscreen password and the startup password was the same. |
|
As of today (20160116) on CM13.0 the following happens:
It would be nice if someone could update us if above changes. |
|
I would rather think that the first argument is the new password type.
|
|
@lithorus, you are correct. Inspecting the code confirms your suggestions. This the commit that introduced the change: CyanogenMod/android_system_vold@a7219c6 The fix would be the following: So the actual format is: Test vector was:
|
|
Thanks everyone for the updates. I'll add support for CM13 once the interface stabilizes, but it seems this is not yet the case. |
This reverts commit fdc8bf6. Change-Id: Iabb466bd762bf92e449913c1091b2d9abe531301
|
Actually I believe CM's interface is stable at least since August-2015.
Both of the above above issues seems to be resolved and we left with two variants of |
|
CM inherited this code from QCOM and, since there is only one call site in the entire code base, it surely wasn't tested for third party usage. I've posted http://review.cyanogenmod.org/#/c/129185 to try and maintain backward compatibility. Can some folks here please test and report back? Thanks! |
|
@tdm Looks good, thanks! Hopefully it gets merged. |
|
I'm sorry to let you know, the only way I got around this was to reset my device; erasing everything.There seems to be a disconnect between the user space and the underlying crypto functions. I really hope we figure it out as this has bit me multiple times. I was hopeful it was a CM13 bug, however I'm no longer sure. |
|
I haven't been able to get it to work on a stock Nexus 6 or a Nexus 6 with CM13 installed.... Android simply refuses to accept the correct password |
|
The image of the data partition won't help unless it's on the phone itself because the key is stored in a trusted execution chip of sorts. What i am wondering is how to reset the number of tries remaining i'm down to 22/30 or if this is even possible. Also wondering if this chip has a hard limit regardless if the attempts are made through boot or twrp. Also wondering if the input keyboard makes a difference, eg qwerty or pin code, and where that flag is stored (data/system/?). Also wondering what exactly the source code says android does when it receives an empty password. There's a bounty to get TWRP working with MM encryption but no takers, I'd probably bump it up significantly if I knew someone would work on it: Looking forward to your guys' findings. If someone is technically capable of researching these issues let me know and I'm happy to pay for your time. Also, the readme for this github needs to be updated because it is giving people the wrong instructions regarding manual password updating through terminal on MM (and other versions possible) which is why I am in this situation to begin with. |
|
I made an image in the hopes that once this was solved I could reflash it and try again, in the mean time I had to wipe the data partition to use my phone. Is this feasible or is there something I'm missing? Do you see some limited number of tries when you say you are down to 22/30? Or are you manually keeping track? I may be over that limited already. |
|
From another conversation on a different thread, there's the possibility cryptfs took the inputted password as hex. take the password you had entered and convert the entire string to hex and see if that works to decrypt. If it's just numbers, all windows calculators have a programmer option which allows you to convert dec <-> hex If the all numerical password had an odd number of digits, you may have to input 0 in front of the hex output when entering it as a password. |
|
@donnm Yes it actually tells you how many tries you have left and despite restarting the phone it will keep that record until you input the correct password and it resets to 30 tries again. After you have exhausted your tries it says it will perform a factory reset (will wipe the data). As for your image it might be different for different phones, the image might still work assuming when android initially boots it doesn't reset the embedded hardware keys. Some phones have encryption on by default in which case it probably would reset them. |
|
If you boot into recovery, without mounting /data, you can reset the number of tries by editing the cryptofooter with a binary editor. Take an image of the cryptofooter partition and analyze it on your PC. See the Santoku-Linux repo. |
|
I tried converting dec->hex with both upper case and lower case characters. Also tried converting string->hex. Doesn't work unfortunately. I will repeat my offer who ever figures this out I will pay more than the cost of a brand new high end phone. @nelenkov if you have time please look into this issue, also update the readme of this git as it doesn't warn of such hazards using the cryptfs without the "old password" variable. |
|
I went to IRC and pointed the CyanogenMod folks at this issue, this was the reply: |
|
Hi everyone, I don't know if it's related, but today I encrypted my CM13 2016-03-03 phone (H815), which has a schema lockscreen. Now I can decrypt successfully when entering the schema at boot, but after that entering it again to unlock doesn't work. I'm locked out of my phone, any idea ? |
|
Ok so just to reiterate, this problem is not exclusive to the CM13 builds, it happened on my MM 6.0.1 T-mobile LG G4 H811. The code seems to use the empty password to encrypt, but as @aradis has pointed out that this does not work to decrypt. Not sure how he did these tests as in some cases if we was using TWRP then TWRP cannot decrypt regardless of if you are using the correct password or not. @aradis any input on how you did these tests would be appreciated. @nelenkov Please update the readme so others don't lose data like I did. I am now offering $2000 to anyone who can figure out how to recover the encrypted data partition after executing cryptfs with an empty password. |
|
@saltlamp I've now compiled TWRP 3.0.0 to accept empty passwords, but haven't been successful testing it yet due to minor issues with my build like ADB not connecting and TWRP's terminal commands not working. I'm getting there though. In the mean time, @aradis please provide more info on how you tested! |
|
@donnm make sure that twrp can decrypt a normally encrypted data partition first since as I mentioned above twrp does not successfully decrypt all the newer phones. |
|
I've updated the README. It has had warnings all along. It is not exactly clear what LG changed to break things with FDE. You should take a full (with |
|
There's no |
|
There must be a fstab file somewhere, check in the root directory. |
|
@nelenkov The warning is well after the actual cryptfs command for Marshmallow and it only warns against CM13 not other MM roms which clearly suffer from this issue. Anyone who goes to this page will run the command thinking it is safe, as there is no indication it can cause potential data loss. Really hoping someone is working on figuring out how to recover from this empty password issue, if you require a higher compensation please request to contact me directly. |
|
I have fixed this in my SnooperStopper app (it includes fork of cryptfs-password-manager). See also pull request #16. Btw. there were no issues on stock Android 6 Google ROM, it has worked without problems (I have tested this extensively on Nexus 5). Only CyanogenMod 13 has been broken. So I really don't know what was @saltlamp problem, maybe LG something broke in their ROM? |
|
FYI, It seems that after a long long time CM has now support for the original AOSP usage of vold cryptfs back in: |
|
Right after I finally added support for there new syntax... |
|
This has recently come to light, which may be of use for those of us who have backup images we are unable to decrypt: https://bits-please.blogspot.ro/2016/06/extracting-qualcomms-keymaster-keys.html |
|
had problems with Cryptfs PWM after updating my Sony Xperia Z3 compact to Android 6.0.1. It worked on KitKat and Lollypop but not with Marshmallow. I use stock rooted rom, not CM. After reading this post and trying it on my device I can confirm that this command now works on my device:
so it would look something like this:
the procedure (via @eugenesan):
|
|
Verified with: CM13.0 snapshot from April 19, 2016. |
|
I can confirm that with LineageOS 14.1 (20170530-nightly-hammerhead) you still need this syntax: It would be great if the README would include such an example. Because the vdc help message doesn't actually match that syntax and is thus misleading: (i.e. it shows 4 arguments to the Also, on my system, vdc signals success for where 1234 seems to be some arbitrarily changing number and the last component denotes the return code (0 -> success, 1 -> failure). Btw, it would also be great if the README would mention Otherwise, the README is a good reference for changing the filesystem password - even if you don't use the app. |
|
Please submit a pull request that Lineage OS details to the readme, and I'll merge. |
Nexus 5 D821
Stock 6.0 build MRA58K
TWRP 2.8.7.1
ElementalX kernel 6.03
SuperSU v2.52
Bootloader state Unlocked
SELinux Enforcing
Initially had a PIN and location based Smart Lock enabled. Encrypted it successfully and rebooted a couple of times to make sure. Then changed disk encryption password using this app, confirmed the password I entered was correct in the pop up after it was done. Rebooted to TWRP recovery, saw that the password was reported as wrong. Rebooted to System, again password seems wrong. Earlier pin isn't not working either, of course.
I am 100% sure the password I'm entering is correct, but decryption fails during boot up and in TWRP. I do have the necessary backups (Nandroid, Titanium) on my computer of course, so I will try again on 100% stock (/system, /data, /recovery, but with chainfire's /boot so as to root) after battery charges up and report back.
The text was updated successfully, but these errors were encountered: