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

Does it still work? #55

Open
marcinguy opened this issue Aug 16, 2019 · 1 comment
Open

Does it still work? #55

marcinguy opened this issue Aug 16, 2019 · 1 comment

Comments

@marcinguy
Copy link

Hi,

Looking for an update from the Author or creditable answers.

Whatsapp Web Client changed JS several times since I looked in to it.

Getting Pub, Priv key is quite hard, but possible. It seems it changes (QR code) and the Priv, Pub key every ca. 10 secs.

I am pretty sure I managed to get the right key (Priv and Pub) as well as secret (Ref Object)

Than I paste base64 encoded message I sent to one of my contacts (websocket -> to server endpoint /ws). It has a format of:

ID,<binary>

In the parser.py
This goes through:

if check_hmac != self.secret[32:64]:

However, got a mismatch here:

raise ValueError("Error hmac mismatch")

As I said I am quite confident I had 32 ints each good Priv and Pub key and secret (Ref Obj).

Is this still working?

Thanks,

@marcinguy marcinguy changed the title Does it still works? Aug 16, 2019
@marcinguy
Copy link
Author

I got Priv and Pub key from JS. As I said they seem to be correct since the assert goes through:

self.public_key = self.private_key.get_public()

assert (self.public_key.serialize() == "".join([chr(x) for x in pub_key_list]))

Hmac on secret string is also valid

if check_hmac != self.secret[32:64]:

So aes_key and mac_key should be correct.

self.aes_key = keys_decrypted[:32]

But the encrypted message hmac fails:

raise ValueError("Error hmac mismatch")

So does the decryption ....

I verified WhatsApp Web Client and "core" JS parts seem to be the same and matching your Python code.

As asked in original issue, anybody has ideas what is happening here?

Thanks,

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