How to stock and use a shiro's salt from database

前端 未结 4 655
余生分开走
余生分开走 2021-02-06 06:44

I use shiro in application for the authenticate. I use hashed password with a salt and I store them in my database like this :

    private User createUserWithHas         


        
4条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-06 07:29

    I change my type for the save of my salt. Now I'm using a byte[] instead of a String.

    ByteSource salt  = randomNumberGenerator.nextBytes(32);
    
    byte[] byteTabSalt  = salt.getBytes();
    

    And I stock the byteTabSalt in my database.

提交回复
热议问题