简体   繁体   English

将编码后的字符串转换为Base64格式时出现未知字符

[英]Unknown characters while converting encoded String to Base64 format

I need to decode the encoded string in my application. 我需要在应用程序中解码编码的字符串。

But while converting encoded string to Base64 format using the following method 但是,使用以下方法将编码后的字符串转换为Base64格式时

  String base64 = new String(Base64.decode(encrypted, 0));

I am getting the base64 string as the below format 我正在将base64字符串作为以下格式

@��Isz6�}{Aq�Mf����o|c����sY�g��f5������H����y����
E/Base64(27610): c����TQ�2� ;OF�ҏ�fz�J�L�"�E�T�8p�9�dF,�/kL]�|��Ͱ�b尷���=%��b��U�K�b�dӅU���f����բ{�D"
�%�����Nؑ3����E��
 ~$P��  ��a�B�r7�L(�
 Qi�������r�

I tried my encoded string in Base64 online,there also I am getting these kind of output. 我在Base64上在线尝试了我的编码字符串,也得到了这类输出。

I tried with another string,there I am getting the same Base64 as Alphanumeric. 我尝试了另一个字符串,得到了与字母数字相同的Base64。

I didnt understand why I am getting this kind of response. 我不明白为什么我得到这种回应。

please suggest 请建议

It's because the string is encrypted, not just encoded with base64. 这是因为字符串是加密的,而不仅仅是使用base64编码。 The bytes you see are encrypted data - you need to find out how it was encrypted and how to decrypt it. 您看到的字节是加密的数据-您需要了解如何对其进行加密以及如何对其进行解密。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM