从字符串转换为Base64字符串JSP



我想在将密码字符串输入数据库之前将其转换为Base64,这样会更安全。我能做到吗?这里的例子来自C#.net:

Byte[]enByte=ASCIIEncoding.ASCI.GetBytes(密码);

string lsPwd=转换.ToBase64String(enByte);

将其转换为Base64根本不安全。使用散列方法,最好使用随机盐。

我已经试过了,它成功了,很抱歉打扰你我的帖子:)

DatatypeConverter dc=null
byte[]decodedBytes=vpass.getBytes()
字符串pass=dc.printBase64Binary(decodeBytes);

最新更新