alfred82santa / whalesong

Whalesong is an asyncio python library to manage WebApps remotely. Currently WhatsappWeb is implemented
https://whalesong.readthedocs.io
MIT License
51 stars 19 forks source link

node version #52

Open jabolina opened 5 years ago

jabolina commented 5 years ago

I was using the whalesong installing it with pip, but this was creating a lot of communicatino between other js modules I have running in my project. So, I want to ask if its ok to you if I create a simple Whalesong version (monitor messages and chats in the beginning), using you js script working with puppeteer?

I'll create a repo and publish in npm for others to use it, if it's ok.

alfred82santa commented 5 years ago

It's perfect. In fact it is one of my todo's #39

jabolina commented 5 years ago

Thanks! I'll add you as a collaborator, I'll be maintaining the repo, trying to keep up with the python version.

jabolina commented 5 years ago

Hi, I'm having some trouble with media messages decryption, this one. Can you say what was the logic?

Thanks!

alfred82santa commented 5 years ago

Well, I copied this code from https://github.com/tgalal/yowsup/issues/1449#issuecomment-377952926

But, more or less, this is the description:

L771: Download file L776: Get media key from message. Fill with '=' in order to complete b64 string (multiple of 3) L779: Compose crypto token (https://signal.org/docs/specifications/doubleratchet/#double-ratchet) L785: Split crypto token in order to get IV and KEY (https://github.com/tgalal/python-axolotl/blob/master/axolotl/util/byteutil.py#L26) L788: Remove last 10 bytes from file (I'm not sure why...) L790: Create decryptor with IV and KEY L792: Decrypt (AES-CBC: https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation) file and finalize (Maybe finalize is about last 10 bytes...)

alfred82santa commented 5 years ago

May be, you could use https://github.com/signalapp/libsignal-protocol-javascript

jabolina commented 5 years ago

Thanks, that works perfectly!