Skip to content
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

Crypt14 #114

Closed
nirhen opened this issue May 5, 2021 · 8 comments
Closed

Crypt14 #114

nirhen opened this issue May 5, 2021 · 8 comments
Milestone

Comments

@nirhen
Copy link

nirhen commented May 5, 2021

Hi - I installed new whatsapp today 4.2 . Chats backup are saved as crypt14.
whatsapp-viewer support only crypt12 .The key i got seems to be invalid.
i'm sure its valid and they change the way they encrypt DBs.

@andreas-mausch
Copy link
Owner

Thank you. Yes, you are right. crypt14 is currently not supported. I need to test it myself and hope it is a minor change.

@torsade
Copy link

torsade commented May 8, 2021

It is a minor change, it still uses AES-256 in counter mode with a 16-byte IV.
The offsets are:
WHATSAPP_DBFILE_SERVERSALT_OFFSET = 14
WHATSAPP_DBFILE_IV_OFFSET = 66
WHATSAPP_DBFILE_CT_OFFSET = 99
WHATSAPP_DBFILE_FOOTER_SIZE = 0

@torsade
Copy link

torsade commented May 9, 2021

I have included the necessary changes into a pull request: #115

@nirhen
Copy link
Author

nirhen commented May 9, 2021

awesome you guys - thanks for the quick response

andreas-mausch added a commit that referenced this issue May 9, 2021
andreas-mausch added a commit that referenced this issue May 9, 2021
andreas-mausch added a commit that referenced this issue May 9, 2021
@andreas-mausch
Copy link
Owner

Thank you @torsade

@cript0nauta
Copy link

cript0nauta commented May 11, 2021

Hi! Do you think it will be possible to migrate a .crypt12 file to a .crypt14 in order to migrate old data to another phone? Based on the crypt14 changes, I think it would just be a matter of changing the header and footer of the file, but I'm not sure about that.

Note: I also have the contents of the old phone's /data/data/com.whatsapp/ including the unencrypted message database, but I don't know how to import it into a new, non-rooted phone.

@ElDavoo
Copy link
Contributor

ElDavoo commented May 28, 2021

Did your offset change again in this night's backup? I noticed IV now starts at byte 67, but don't know about the rest.
edit: offsets updated here

@cript0nauta
Copy link

Hi! Do you think it will be possible to migrate a .crypt12 file to a .crypt14 in order to migrate old data to another phone? Based on the crypt14 changes, I think it would just be a matter of changing the header and footer of the file, but I'm not sure about that.

I tried to solve this by installing the newest Whatsapp version in the older phone so it creates a .crypt14 backup. Even after that, importing the data into the new phone failed with an unknown error. I ended up copying the entire unencrypted /data/data/com.whatsapp/ contents into the new phone and that worked ok.

Did your offset change again in this night's backup? I noticed IV now starts at byte 67, but don't know about the rest.

I'm surprised abouth how WA doesn't care about backwards compatibility at all and requires rooting my phone just to migrate the messages. So thanks a lot for maintaining an open-source workaround on that, it must be a very difficult task!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants