Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 Java 中将 SALT 值生成为至少 32 个字节长的字符串的最佳方法是什么?
final Random r = new SecureRandom(); byte[] salt = new byte[32]; r.nextBytes(salt); /** String encodedSalt = Base64.encodeBase64String(salt); */
在 SpringSecurity 你可以使用org.springframework.security.crypto.keygen.KeyGenerators
org.springframework.security.crypto.keygen.KeyGenerators
http://static.springsource.org/spring-security/site/docs/3.1.x/apidocs/org/springframework/security/crypto/keygen/KeyGenerators.html
http://docs.spring.io/spring-security/site/docs/3.2.x/reference/htmlsingle/#spring-security-crypto-keygenerators