tgalal / yowsup

The WhatsApp lib
GNU General Public License v3.0
7.07k stars 2.23k forks source link

Incorrect padding while decoding the password #91

Closed parthmehta closed 9 years ago

parthmehta commented 11 years ago

After successful registration and receiving the password, i tried to send a message and got the following error :

D:\whatsapp\yowsup-master\yowsup-master\src>yowsup-cli.py -c config.example -d --send XXXXXXXXXXXX Hello

Traceback (most recent call last): File "D:\whatsapp\yowsup-master\yowsup-master\src\yowsup-cli.py", line 232, in

password = identity or password if args["v1"] else base64.b64decode(password ) File "C:\Python27\lib\base64.py", line 76, in b64decode raise TypeError(msg) TypeError: Incorrect padding Its running on Python 2.7 and even I have added a proper password in the config file.
shirioko commented 11 years ago

http://stackoverflow.com/questions/3302946/how-to-base64-url-decode-in-python

User error, make sure you copy the whole password including the trailing '==' characters

parthmehta commented 11 years ago

Thanks shirioko.

I tried with suffixing multiple equal to ("=") signs at the end but had no luck . Even tried the following :

base64.b64decode(s + '=' * (4 - len(s) % 4)) where s is the string to decode.

When I decode it on online decoders it was decoding it. So later I just changed the password by making a --exists call from yowsup and updated the config.example file with the new credentials and now its decoding but giving a Auth failure error as below :

D:\whatsapp\yowsup-master\yowsup-master\src>yowsup-cli.py -c config.example -d - -send 91XXXXXXXXXX "hello"

Detected cc: 91 YowsupConnectionManager: >>>>>>>> AUTH CALLED BinTreeNodeReader: Reader init Connecting to c.whatsapp.net WAuth: Yowsup WAUTH-1 INIT WAuth: Starting stream WAuth: Sending Features BinTreeNodeWriter: Outgoing BinTreeNodeWriter: stream:features

/w:profile:picture /w:profile:picture /stream:features WAuth: Sending Auth BinTreeNodeWriter: Outgoing BinTreeNodeWriter: WAuth: Read stream start WAuth: Read features and challenge BinTreeNodeReader: Incoming BinTreeNodeReader: stream:features /w:profile:picture /stream:features WAuth: GOT FEATURES !!!! BinTreeNodeReader: Incoming BinTreeNodeReader: Dm+FòKc6ú--++¦S¦?Gî+ WAuth: GOT CHALLENGE !!!! WAuth: Sending Response BinTreeNodeWriter: Outgoing BinTreeNodeWriter: á¦u¶ îêh?Y?+S??B7+uû-+?&?Ä°??¦ÿ¶2í+?-?óì0å=+ WAuth: Read success BinTreeNodeReader: Incoming BinTreeNodeReader: WAuth: Login Status: failure AUTH FAIL Auth Failed! Please suggest