I want encrypt the password in ssha. Exists a method to do it? I found this but is in sha.
private String encrypt(final String plaintext) {
MessageDigest md = null;
try {
md = MessageDigest.getInstance("SHA");
} catch (NoSuchAlgorithmException e) {
throw new RuntimeException(e.getMessage());
}
try {
md.update(plaintext.getBytes("UTF-8"));
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e.getMessage());
}
byte raw[] = md.digest();
String hash = (new BASE64Encoder()).encode(raw);
return hash;
}
SSHA is just SHA with a seed. In the standard java platform there is no possible solution to do so (https://stackoverflow.com/a/3983415/1976843). You need to implement your own or use third party library. I know that in spring security there is LdapPasswordEncoder