[GH-ISSUE #47] zlib error incorrect header check #44

Closed
opened 2026-02-25 20:34:31 +03:00 by kerem · 2 comments
Owner

Originally created by @cgarz on GitHub (Feb 16, 2020).
Original GitHub issue: https://github.com/B16f00t/whapa/issues/47

I'm trying to decrypt a database from an old backup. However the backup inexplicably didn't have the key.
After reading issue #11 I proceeded to generate a new key.
So I restored the app and the data with TitaniumBackup and the old Whatsapp folder with the database to the root of the sd card.
This allowed Whatsapp to access the database after verifying with SMS and created a key in /data. However I am unable to proceed past the zlib decompression phase.

I notice the IV comes from the data. Does that need to also change or something when a new key is generated?

Other backups that had the key decrypt just fine.

Oh and thanks a bunch for making this awesome tool 😃

Originally created by @cgarz on GitHub (Feb 16, 2020). Original GitHub issue: https://github.com/B16f00t/whapa/issues/47 I'm trying to decrypt a database from an old backup. However the backup inexplicably didn't have the key. After reading issue #11 I proceeded to generate a new key. So I restored the app and the data with TitaniumBackup and the old Whatsapp folder with the database to the root of the sd card. This allowed Whatsapp to access the database after verifying with SMS and created a key in /data. However I am unable to proceed past the zlib decompression phase. I notice the IV comes from the data. Does that need to also change or something when a new key is generated? Other backups that had the key decrypt just fine. Oh and thanks a bunch for making this awesome tool :smiley:
kerem closed this issue 2026-02-25 20:34:31 +03:00
Author
Owner

@B16f00t commented on GitHub (Feb 16, 2020):

The method in issue 11, is no longer valid, whatsapp generates a new key, so the only way currently is to copy the database, with the name msgstore.sb.crypt12 into the whatsapp/databases folder and restore the copy from the phone.

<!-- gh-comment-id:586715552 --> @B16f00t commented on GitHub (Feb 16, 2020): The method in issue 11, is no longer valid, whatsapp generates a new key, so the only way currently is to copy the database, with the name msgstore.sb.crypt12 into the whatsapp/databases folder and restore the copy from the phone.
Author
Owner

@cgarz commented on GitHub (Feb 17, 2020):

Ah I see. Thanks for the info.
I actually managed to get it another way. I was mistakenly assuming that /sdcard/Whatsapp/Databases/msgstore.db.crypt12 actually WAS the wa database. But looks like its actually under /data/data/com.whatsapp/databases/msgstore.db. So I was able to simply copy it from there.

My only trouble now is merging my old database with my new one. Seems the structures of the DBs are different. But that's a separate issue. So I'll close this and open a new one.
Thanks 😃

<!-- gh-comment-id:586771426 --> @cgarz commented on GitHub (Feb 17, 2020): Ah I see. Thanks for the info. I actually managed to get it another way. I was mistakenly assuming that /sdcard/Whatsapp/Databases/msgstore.db.crypt12 actually WAS the wa database. But looks like its actually under /data/data/com.whatsapp/databases/msgstore.db. So I was able to simply copy it from there. My only trouble now is merging my old database with my new one. Seems the structures of the DBs are different. But that's a separate issue. So I'll close this and open a new one. Thanks :smiley:
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/whapa#44
No description provided.