如何解决此错误-Base-64字符串中的无效字符. [英] how to solve this error -Invalid character in a Base-64 string.

查看:3394
本文介绍了如何解决此错误-Base-64字符串中的无效字符.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

URL中有两个参数frm = table&id = 24,则其加密的URL为
:enc =/3wUm3yXa4unZoIYymf8mHqQTVE5wB6Xyn2Kqfsnlu + DQyKYzrBop + 7wxuKxjUGN
对于解密,我使用byte [] crypto = convert.fromBase64String(inputstr);它在Base-64字符串中给出错误-无效字符.我该怎么办?

there are two parameters frm=table& id=24in url , then its encrypted url is
:enc=/3wUm3yXa4unZoIYymf8mHqQTVE5wB6Xyn2Kqfsnlu+DQyKYzrBop+7wxuKxjUGN
and for decryption i use byte[] decrypt=convert.fromBase64String(inputstr); it gives an error -Invalid character in a Base-64 string. what can i do?

推荐答案

您必须先将chars +,/替换为加密字符串中的其他chars,然后再发布,不会有问题解密.发布进行交叉检查后,将其替换为可比较的解密字符串,然后进行比较,或将替换的字符放回发布处理事件中.
You have to replace the chars +, / with different chars from the encrypted string before posting, there there won''t be problem in the decryption. After posting to cross check, replace the same in the comparable decrypted string and make the comparison or put back the replaced chars back in the post handling event.


这篇关于如何解决此错误-Base-64字符串中的无效字符.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆