Home > Back-end >  What reason RSA decryption appear some Chinese garbled???????
What reason RSA decryption appear some Chinese garbled???????

Time:10-07




CodePudding user response:

Why do some good in Chinese

CodePudding user response:

Solve the big bosses

CodePudding user response:

GBK output coding is not clear, or UTF8, lead to test with different coding Chinese data,

This method design is unreasonable, encryption to decrypt are binary data, you provide methods also should be a binary input and output, the text of the codec should not be included in this method
Or put the CHARSET as an input parameter

CodePudding user response:

Part of the code is a bit strange, what you have to confirm the actual character is

Information you provide is too little, can't the specific location

CodePudding user response:

If there is no problem, encryption decryption algorithm is the most likely problem point lies in the encrypted data storage and transmission,
Because the encrypted data is itself a bytecode, is not a string, the process of forcing it into a string as part of the bytecode cannot be found in the character code corresponding value by the system with the default character substitution,
Since the encrypted data has been changed, of course likely cannot recover after decoding,
Suggest LZ check before and after the encryption of data storage format, and to ensure that the data after decryption and encryption before the data using the same encoding to the transformation of the string,
  • Related