[GH-ISSUE #147] Update the new crypt 14 offset! #134

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

Originally created by @mrmc-mc on GitHub (Dec 12, 2021).
Original GitHub issue: https://github.com/B16f00t/whapa/issues/147

I think in the new version of whatsapp[my version: 2.21.23.23], encoding of key and database files has been changed.
As a result, the offset position has also changed.

I use latest version of repository for decrypt .crypt14 file (several times) and every time I got an error . I'm sure the files are correct

Error ;

Error -3 while decompressing data: incorrect header check
Originally created by @mrmc-mc on GitHub (Dec 12, 2021). Original GitHub issue: https://github.com/B16f00t/whapa/issues/147 I think in the new version of whatsapp[my version: 2.21.23.23], encoding of key and database files has been changed. As a result, the ` offset ` position has also changed. I use latest version of repository for decrypt ` .crypt14 ` file (several times) and every time I got an error . I'm sure the files are correct Error ; ``` Error -3 while decompressing data: incorrect header check ```
kerem 2026-02-25 20:34:43 +03:00
Author
Owner

@Eligio-Cazo commented on GitHub (Dec 17, 2021):

The encryption of crypt14 is not correct, I have it done in python in case you are interested.

<!-- gh-comment-id:996983642 --> @Eligio-Cazo commented on GitHub (Dec 17, 2021): The encryption of crypt14 is not correct, I have it done in python in case you are interested.
Author
Owner

@mrmc-mc commented on GitHub (Dec 17, 2021):

The encryption of crypt14 is not correct, I have it done in python in case you are interested.

Yes, Sure. Please let us know how you did

<!-- gh-comment-id:996986157 --> @mrmc-mc commented on GitHub (Dec 17, 2021): > The encryption of crypt14 is not correct, I have it done in python in case you are interested. Yes, Sure. Please let us know how you did
Author
Owner

@Eligio-Cazo commented on GitHub (Dec 17, 2021):

In def encrypt14
You need change
header = db_cript_data[0:191]
iv = db_cript_data[67:83]
and remove 'iv' in fh.write(header +iv+ aes.encrypt(zlib.compress(data)) + footer)

in def decryp14
only chage
header = db_cript_data[0:191]
iv = db_cript_data[67:83]

<!-- gh-comment-id:997002778 --> @Eligio-Cazo commented on GitHub (Dec 17, 2021): In def encrypt14 You need change header = db_cript_data[0:191] iv = db_cript_data[67:83] and remove 'iv' in fh.write(header +iv+ aes.encrypt(zlib.compress(data)) + footer) in def decryp14 only chage header = db_cript_data[0:191] iv = db_cript_data[67:83]
Author
Owner

@mrmc-mc commented on GitHub (Dec 17, 2021):

In def encrypt14 You need change header = db_cript_data[0:191] iv = db_cript_data[67:83] and remove 'iv' in fh.write(header +iv+ aes.encrypt(zlib.compress(data)) + footer)

in def decryp14 only chage header = db_cript_data[0:191] iv = db_cript_data[67:83]

in the current decrypt14 function :

        data = db_data[191:]
        iv = db_data[67:83]
        aes = AES.new(key, mode=AES.MODE_GCM, nonce=iv)
        with open(path, "wb") as fh:
            fh.write(zlib.decompress(aes.decrypt(data)))

header detached in the 191-byte positon
Where it should change according to you?

<!-- gh-comment-id:997053973 --> @mrmc-mc commented on GitHub (Dec 17, 2021): > In def encrypt14 You need change header = db_cript_data[0:191] iv = db_cript_data[67:83] and remove 'iv' in fh.write(header +iv+ aes.encrypt(zlib.compress(data)) + footer) > > in def decryp14 only chage header = db_cript_data[0:191] iv = db_cript_data[67:83] in the current decrypt14 function : ``` data = db_data[191:] iv = db_data[67:83] aes = AES.new(key, mode=AES.MODE_GCM, nonce=iv) with open(path, "wb") as fh: fh.write(zlib.decompress(aes.decrypt(data))) ``` header detached in the 191-byte positon Where it should change according to you?
Author
Owner

@B16f00t commented on GitHub (Dec 17, 2021):

If the scripts works, you can propose to make a pull request to fix the issue

<!-- gh-comment-id:997059042 --> @B16f00t commented on GitHub (Dec 17, 2021): If the scripts works, you can propose to make a pull request to fix the issue
Author
Owner

@Eligio-Cazo commented on GitHub (Dec 18, 2021):

Changes must be made in whacipher.py file
The encrypt14 function is missing, the code can be copied from the decryp12 function and make the changes so that encrypt with crypt14 works as well

<!-- gh-comment-id:997123592 --> @Eligio-Cazo commented on GitHub (Dec 18, 2021): Changes must be made in whacipher.py file The encrypt14 function is missing, the code can be copied from the decryp12 function and make the changes so that encrypt with crypt14 works as well
Author
Owner

@mrmc-mc commented on GitHub (Dec 18, 2021):

Changes must be made in whacipher.py file The encrypt14 function is missing, the code can be copied from the decryp12 function and make the changes so that encrypt with crypt14 works as well

The file I am trying to decrypt was created and encrypted by WhatsApp itself and taken from the database folder: /sdcard/Whatsapp/Databases/msgstore.db.crypt14.
If your code works properly And decrypts .crypt14 file correctly, please share it with us with more details

<!-- gh-comment-id:997149197 --> @mrmc-mc commented on GitHub (Dec 18, 2021): > Changes must be made in whacipher.py file The encrypt14 function is missing, the code can be copied from the decryp12 function and make the changes so that encrypt with crypt14 works as well The file I am trying to decrypt was created and encrypted by WhatsApp itself and taken from the database folder: ` /sdcard/Whatsapp/Databases/msgstore.db.crypt14 `. If your code works properly And decrypts ` .crypt14 ` file correctly, please share it with us with more details
Author
Owner

@Eligio-Cazo commented on GitHub (Dec 19, 2021):

I have posted a version to encrypt and decrypt crypt14, it is a compilation of several versions that I found to encrypt and decrypt crypt14. In May 2021 the offset of the file was changed.
The comments on the file are in Spanish, sorry.

https://github.com/Eligio-Cazo/Desencriptar_crypt14

<!-- gh-comment-id:997439540 --> @Eligio-Cazo commented on GitHub (Dec 19, 2021): I have posted a version to encrypt and decrypt crypt14, it is a compilation of several versions that I found to encrypt and decrypt crypt14. In May 2021 the offset of the file was changed. The comments on the file are in Spanish, sorry. https://github.com/Eligio-Cazo/Desencriptar_crypt14
Author
Owner

@Mrakobes666 commented on GitHub (Feb 24, 2022):

I replaced a piece of code in the file "whacipher.py" but still

Error -3 while decompressing data: incorrect header check

<!-- gh-comment-id:1049572777 --> @Mrakobes666 commented on GitHub (Feb 24, 2022): I replaced a piece of code in the file "whacipher.py" but still Error -3 while decompressing data: incorrect header check
Author
Owner

@Baneeishaque commented on GitHub (Apr 28, 2022):

The issue remains, please reopen.

<!-- gh-comment-id:1111793803 --> @Baneeishaque commented on GitHub (Apr 28, 2022): The issue remains, please reopen.
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#134
No description provided.