* Fix messaging [WIP] * Make codeclimate happy * Codeclimate, pls * got it, i hope * Improvements * Remove duplicated checks, other improvements, make login/logout broadcasts * Optimize project imports * Make codeclimate happy again
26 lines
792 B
Java
26 lines
792 B
Java
package fr.xephi.authme.security.crypts;
|
|
|
|
import fr.xephi.authme.security.crypts.description.HasSalt;
|
|
import fr.xephi.authme.security.crypts.description.Recommendation;
|
|
import fr.xephi.authme.security.crypts.description.SaltType;
|
|
import fr.xephi.authme.security.crypts.description.Usage;
|
|
import fr.xephi.authme.util.RandomStringUtils;
|
|
|
|
import static fr.xephi.authme.security.HashUtils.sha1;
|
|
|
|
@Recommendation(Usage.ACCEPTABLE)
|
|
@HasSalt(value = SaltType.TEXT, length = 40)
|
|
public class Wbb3 extends SeparateSaltMethod {
|
|
|
|
@Override
|
|
public String computeHash(String password, String salt, String name) {
|
|
return sha1(salt.concat(sha1(salt.concat(sha1(password)))));
|
|
}
|
|
|
|
@Override
|
|
public String generateSalt() {
|
|
return RandomStringUtils.generateHex(40);
|
|
}
|
|
|
|
}
|