When using crypto JS to decrypt, an error may be reported:
Malformed UTF-8 data
Error: Malformed UTF-8 data
at Object.stringify (d:\StudeyCode\myStudy\encryptDemo\routes\encrypt\crypto-js.js:478:27)
at WordArray.init.toString (d:\StudeyCode\myStudy\encryptDemo\routes\encrypt\crypto-js.js:215:41)
at decryptByDESModeCBC (d:\StudeyCode\myStudy\encryptDemo\routes\encrypt\crypto.js:90:22)
at testSign (d:\StudeyCode\myStudy\encryptDemo\routes\test.js:34:18)
at Layer.handle [as handle_request] (d:\StudeyCode\myStudy\encryptDemo\node_modules\express\lib\router\layer.js:95:5)
at next (d:\StudeyCode\myStudy\encryptDemo\node_modules\express\lib\router\route.js:137:13)
at Route.dispatch (d:\StudeyCode\myStudy\encryptDemo\node_modules\express\lib\router\route.js:112:3)
at Layer.handle [as handle_request] (d:\StudeyCode\myStudy\encryptDemo\node_modules\express\lib\router\layer.js:95:5)
at d:\StudeyCode\myStudy\encryptDemo\node_modules\express\lib\router\index.js:281:22
at Function.process_params (d:\StudeyCode\myStudy\encryptDemo\node_modules\express\lib\router\index.js:335:12)
The reason for the error is: when des decrypts, if the encrypted data is not an integral multiple of 8, the above error will be reported,
solution: encrypt the data, and then encrypt it with Base64. When decrypting, first decrypt it with Base64, and then decrypt it with DES. The above problems can be solved.
Read More:
- The fastest way to solve the problem of error reporting from crypto.cipher import AES
- JS Ajax request is successful, the response displays “failed to load response data”
- [mybatis] error: malformed ognl expression: name! = null and name! = ‘”
- [PHP]stream_socket_client(): Failed to enable crypto
- ERROR in static/js/app.xxxxxxx.js from UglifyJs Unexpected token: operator (>)
- Solve the problem of postgre error #22p02 malformed array literal
- yum install/update error: sqlite3.DatabaseError: database disk image is malformed
- Inconsistency between adapter data and UI data after dragging recyclerview (data disorder)
- MalformedJsonException:Use JsonReader.setLenient(true) to accept malformed JSON at line 3 colum
- circuit_breaking_exception,“reason“:“[parent] Data too large, data for [<http_request>]
- Gson Parsing exceptions: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $
- SCRIPT1002: syntax error File: 0. chunk.js ,SCRIPT5009: ‘Map‘ is undefined File: 0. chunk.js -Solutions
- Django + jQuery get data in the form + Ajax send data
- Failed to load response data:No data found for resource with given identifie
- No data: data: get host by name failed in TCP_ Connect() error resolution
- How to Fix Sklearn ValueError: This solver needs samples of at least 2 classes in the data, but the data
- Data analysis to obtain Yahoo stock data: some problems are encountered when using panda datareader (cannot import name ‘is_ list_ Like ‘problem)
- [MySQL] [serialize] [error record] after modifying data, no data will be returned (in fact, MySQL does not support it)
- This (code, message, data: null) still exists after importing spring cloud project into Lombok; the data in the project is unrecognized
- ERROR 1406 (22001): Data Too Long, field len 30, data len 48