Knowledge map advanced must read: read how large-scale map data efficient storage and retrieval>>>
Today, I encountered an exception when developing a small program to obtain the mobile phone number bound to wechat: javax. Crypto. Badpaddingexception: pad block corrupted
After tossing about for a long time, I suddenly thought of it because:
First, get the encrypted data of mobile phone number through getphonenumber
Then call Wx. Login to get the code
Then get the user’s session by code_ key 。
Finally, use session_ Key, the encrypted data of the mobile phone number and vector decryption to obtain the mobile phone number
The correct approach should be as follows:
Get the code by calling wx.login first
Then get the user’s session through the code_ key 。
Then get the encrypted data of mobile phone number through getphonenumber
Finally, use session_ Key, the encrypted data of the mobile phone number and vector decryption to obtain the mobile phone number
After the reform, there was no problem
This is due to the session obtained by code after calling Wx. Login_ Key is a new session_ key.
Therefore, the encrypted data obtained before calling Wx. Login is not a new session_ Key encrypted data
The encrypted data obtained after calling Wx. Login is the new session_ Key encrypted data
Similar Posts:
- Obnoxious permission denied: how does ADB handle permission denied when accessing mobile directory
- How to connect Android mobile phone with ADB & reasons and solutions of unable to connect to 192.168.1.100:5555
- Program license agreement has been updated
- [Android test] solution to error closed after ADB shell carriage return
- The ADB command installs APK, and the installation problem is solved by daemon not running. Starting it now on port 5037
- mcrypt_ module_ The successful solution of open abandoned by php7.1
- Android studio can’t find the emulator and can’t connect to the mobile phone. Prompt adb.exe start server ‘failed — run manually if necessary
- Solve the problem of “typeerror: ‘bool’ object is not callable” in flash and Django
- iPhone has denied the launch request
- Android system/app/ VS system/priv-app/