Decrypt WhatsApp encrypted media files
github.com
github.com
> A recent high-profile forensic investigation reported that “due to end-to-end encryption employed by WhatsApp, it is virtually impossible to decrypt the contents of the downloader [.enc file]
This quote clearly means it is virtually impossible without the key. OF COURSE if you have full access to the device as a logged in user, then you can get access to the key and decrypt things that cannot be decrypted by others who do not have the key. Nothing to see here.
At least to the author’s credit the FAQ answers below clarify this, but not after the lead in, which is all most people read, has already done the damage of dramatically planting the incorrect impression that someone has figured out how to break WhatsApp encryption.
That quote is from the data forensics report on Bezos' phone, so the missing context was them stating that even with a full logical file data acquisition, they couldn't decrypt the .enc file. That is what inspired me to write this tool to demonstrate how end-to-end encryption is only impossible to decrypt by intermediate hosts, it's very possible with full access to the filesystem of one of the endpoints.
I could likely make that part of the README clearer by adding more context from the original forensics report that was published.
Thanks!
-Dino
This tool is a response to that - that that statement by the forensic investigator is nonsense, because if you have full access to the device (as they did), you can easily extract the decryption key for media files present on the device.
The quote isn't out of context, the quote is just nonsense and wrong. They had the key.
- Alice encrypts message using FAKE public key of Bob (she was told is Bob's key by the server), sends it to whatseverapp server so it can be delivered to Bob when he sign on.
- Whatseverapp server has FAKE private key for Bob (it generated that one itself, after all), decrypts message and notifies the corporate overlords/government/Russians/AdSevers/Illuminati of contents.
- Whatseverapp server encrypt message using REAL public key of Bob, sends it to Bob
- Bob decrypts the message using his REAL public key, reads it.
This out-of-ban verification is nothing you can automate or do once-for-all, like analyzing the binary for bad stuff. Each user has to verify the key of the other users. Which very few people actually do.
Also, you make it sound so easy to analyze an app binary. You can relatively easily prove it does certain things; but to prove a negative, namely that it does NOT do certain things is far more difficult at least and outright infeasible or even impossible in other cases (compare with halting problem). This is why security vulnerabilities happen, and a backdoor is more or less just a security vulnerability that didn't happen by accident or incompetence but deliberately - which may mean whoever put it there might have spent some time to obfuscate it even further to make it harder to find.
It can be used to decrypt other's files as long as there is physical access to the device and the user's passcode. This was published as a result of the Bezo's phone examination report, where the author stated it was impossible to decrypt the media file. A claim that was largely refuted by the digital forensics community.
And here's a desktop viewer to search through decrypted files: https://forum.xda-developers.com/showthread.php?t=1583021 (last updated: 2018).
Every needs to be incredibly careful of being phished of their WhatsApp web logins.
Also, WhatsApp does not respect message integrity regardless of e2e encryption. They WILL mutate your message if required.
When you export a chat, you get a zip file containing the messages as plain text, plus any media files referenced in the chat. The .txt file unfortunately only contains the text-only messages, not the text captions for media items. I reported this as a bug and was told this was functioning as intended.
So this is a warning to anyone who thinks they are backing up their WhatsApp chats via the export feature that their backups are incomplete.
As a workaround, you can get hold of the ChatStorage.sqlite file from an iTunes backup of your phone. All text is in there but you obviously have to query the database and format it into a readable sequence of messages.
This really, really sucks as a workflow and I hope if any WhatsApp engineers ever read this they start working on a real export feature.
I forward messages between various groups, but when you forward a media item like an image, it doesn't forward the caption with it. This is incredibly frustrating - sometimes you don't realize you've forwarded a photo of something that has no context, and my recipients have been often clueless until I have to clarify.
I only use apps for which I can get data out of the walled garden and into a sane Linux environment. Ironically, considering the generally oppressive lockdown of the iOS environment, the prevalent use of SQLite databases means you can frequently get a good machine-readable extract.
The weak link is iTunes. I know that one day they will kill it and make backups totally opaque, and that will be the end of me using iDevices.
Answering the most important questions.
Citation required...
Didn't we learn that not to be the case since presumably the device can still flash a new apple-signed firmware that would override this ?
Anyway, a hypothetical alternative firmware couldn't just magically bypass the encryption. What it could have done, and I think this may only apply to older iPhone models as it's now handled by the Secure Enclave(?), is make it easier to brute-force the pincode (no lockout, less delay).
It also doesn't really matter whether the compromise is a direct key extraction or just defeating the anti-bruteforce protections, the root flaw here is with the phone accepting new privileged software while locked and still retaining its state.
No, but it could presumably brute force the pin (unless the rate limiting is hardware controlled?) or wait until the user enters it, then decrypt everything.
I think this is the case on newer iPhones. But it might be flawed somehow given how Cellebrite were still able to brute-force?
I'm talking about having device data preserved and made accessible, while the device is screen-locked, without having any credentials or the passcode - pick all three.
Local backup key strength depends on the key. iCloud depends on the law.
But if you lose the passcode to your screen-locked or unpowered device any way of getting data (that has not been backed up) out of it, while it's locked or turned off implies a security flaw even if done via a firmware signed by Apple.