Java简单加密 [英] Java simple encryption
问题描述
我想加密存储在磁盘上的文本(配置)文件。
尝试使用 DES 加密我在客户端机器上发生了致命错误,我后来发现算法无法处理重音字符(!)
我怀疑是因为我使用旧包( sun.misc.BASE64Decoder
) - 但我'不知道是什么原因。
然而,我正在寻找一个更简单的解决方案 - 我需要一个非常简单的加密(我知道有些人不会同意) - 不是使用128位键的 RSA ,只是将文字从好奇的眼睛中遮蔽起来。 p>
真的很奇怪,我在网络上找不到一个简单的平凡的解决方案。
如何实现简单的加密方案?
查看 Java简化加密(Jasypt)。
Jasypt是一个java库,允许
开发人员为他/她的项目添加基本加密
功能
最小的努力,而不需要
深入了解
加密技术的工作原理。
- 高安全性,基于标准的加密技术,无论是
单向和双向
加密。加密密码,文本,
数字,二进制文件...
- 与Hibernate透明集成
- 适用于集成到基于Spring的应用程序和
可透明地与ACEGI
(Spring Security)集成。
- 用于加密
应用程序(即数据源)配置的集成功能。 >
- 开放API用于任何JCE提供者。
- ...等等
I would like to encrypt a textual (configuration) file stored on disk.
Trying to use DES encryption I've had fatal error on client machines, I later found out the algorithm could not handle accented characters (!)
I suspect that was because I was using old packages (sun.misc.BASE64Decoder
) - but I'm not sure that is the reason.
However, I'm looking for a simpler solution - I need a really simple encryption (I know some people would not agree on that) - not RSA of 128 bit keys or so, just obscuring the text from curious eyes.
It is really weird that I could not find a simple trivial solution on the web.
How can I implement a simple encryption scheme?
Check out the Java Simplified Encryption (Jasypt).
Jasypt is a java library which allows the developer to add basic encryption capabilities to his/her projects with minimum effort, and without the need of having deep knowledge on how cryptography works.
- High-security, standards-based encryption techniques, both for unidirectional and bidirectional encryption. Encrypt passwords, texts, numbers, binaries...
- Transparent integration with Hibernate.
- Suitable for integration into Spring-based applications and also transparently integrable with ACEGI (Spring Security).
- Integrated capabilities for encrypting the configuration of applications (i.e. datasources).
- Open API for use with any JCE provider.
- ...and much more
这篇关于Java简单加密的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!