update: encryption

This commit is contained in:
EUForest 2025-11-24 15:59:03 +08:00
parent 95ddba2332
commit d22659ff04

View File

@ -46,8 +46,6 @@ func MultiPasswordVerify(algo, salt, password, hash string) bool {
case "md5salt": case "md5salt":
sum := md5.Sum([]byte(password + salt)) sum := md5.Sum([]byte(password + salt))
return hex.EncodeToString(sum[:]) == hash return hex.EncodeToString(sum[:]) == hash
case "default": // PPanel's default algorithm
return VerifyPassWord(password, hash)
case "bcrypt": case "bcrypt":
// Bcrypt (corresponding to PHP's password_hash/password_verify) // Bcrypt (corresponding to PHP's password_hash/password_verify)
err := bcrypt.CompareHashAndPassword([]byte(hash), []byte(password)) err := bcrypt.CompareHashAndPassword([]byte(hash), []byte(password))