加密

Shiro加密:

//加密算法 String hashAlgorithName="MD5"; //加密明文 String credentials="123456"; //加密盐值 ByteSource salt = null; //加密盐值 //盐值通常取唯一的,我们这用用户名作为盐值 //ByteSource salt= ByteSource.Util.bytes(username); //加密次数 int hashIterations = 1024; Object password = new SimpleHash(hashAlgorithName,credentials,salt,hashIterations);

posted @ 2017-12-27 22:02  笔记Next  阅读(134)  评论(0编辑  收藏  举报