在Java中加密和解密密码 [英] Encrypt and decrypt a password in Java

查看:131
本文介绍了在Java中加密和解密密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Java中加密和解密密码,并以加密的形式存储到数据库中。
如果它是开源的,这将是很棒的。任何建议/指针?

解决方案

MD5必须足够好,我想象?您可以使用 MessageDigest 实现此目的。



MessageDigest.getInstance(MD5);



还有其他算法列出了 here



这里是第三方版本,如果你真的想要:
快速MD5


I want to encrypt and decrypt a password in Java and store into database in the form of encrypted. It will great if it is open source. Any suggestions / pointers ?

解决方案

MD5 must be good enough for you I imagine? You can achieve it with MessageDigest.

MessageDigest.getInstance("MD5");

There are also other algorithms listed here.

And here's an third party version of it, if you really want: Fast MD5

这篇关于在Java中加密和解密密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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