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

Update the new crypt 14 offset! #147

Closed
mrmc-mc opened this issue Dec 12, 2021 · 10 comments
Closed

Update the new crypt 14 offset! #147

mrmc-mc opened this issue Dec 12, 2021 · 10 comments
Labels
enhancement New feature or request

Comments

@mrmc-mc
Copy link

mrmc-mc commented Dec 12, 2021

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
@B16f00t B16f00t added the enhancement New feature or request label Dec 14, 2021
@Eligio-Cazo
Copy link

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

@mrmc-mc
Copy link
Author

mrmc-mc commented 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

@Eligio-Cazo
Copy link

Eligio-Cazo commented 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]

@mrmc-mc
Copy link
Author

mrmc-mc commented 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?

@B16f00t
Copy link
Owner

B16f00t commented Dec 17, 2021

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

@Eligio-Cazo
Copy link

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

@mrmc-mc
Copy link
Author

mrmc-mc commented 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

@mrmc-mc mrmc-mc closed this as completed Dec 19, 2021
@Eligio-Cazo
Copy link

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

@Mrakobes666
Copy link

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

Error -3 while decompressing data: incorrect header check

@Baneeishaque
Copy link
Contributor

The issue remains, please reopen.

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

No branches or pull requests

5 participants