shiro 源碼加密方式

/**
 * @description 源碼的加密方式
 * @param args
 */
public static void main(String[] args) {
    // 加密的方式
    String hashAlgorithmName = "MD5";
    // 明文的密碼
    Object credentials = "123456";
    // 鹽值
    Object salt = ByteSource.Util.bytes("98k");
    // 加密的次數
    int hashIterations = 1024;
    Object result = new SimpleHash(hashAlgorithmName, credentials, salt, hashIterations);
    // result:加密過後的密碼
    System.out.println(result);
}

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章