English 中文(简体)
简单的 Java 加密 W/ JSON 方便的编码?
原标题:Simple Java encryption w/ JSON-friendly encoding?

我在找一个简单的 Java 加密解决方案, 让我可以指定编码, 这样加密的数据可以嵌入 JSON 文件中 。

< 坚固> 为什么? 我的网络服务在出错时返回描述性 JSON 信息。 如果出现内部服务器错误, 我愿意包含包含诊断信息的字段, 但是我要加密这些数据以避免潜在的安全问题 。

加上JSON和猴子。

"https://i.sstatic.net/eFPT0.jpg" alt="YouTube 500 错误"/ >

最佳回答

正如Hot Licks所说, 使用您选择的方法加密, 以达到您想要的安全级别 。 然后根据这些数据使用 Base64 编码, 方便您在 JSON 中传输 。 周围有多个 Base64 库。 请查看这些堆叠溢出的答案, 以找到 Java 良好的加密选项 :

< a href=" "https://stackoverflow.com/ questions/1354803/java-simple- encription" > Java 简单加密

< a href=>"https://stackoverflow.com/ questions/1205135/how-to-encrypt-string-in-java" 如何在爪哇加密字符串

问题回答

加密数据, 然后以 < a href=" http://en.wikipedia.org/wiki/Base64" rel = "nofollow" > base64 字符串返回数据 。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签