Documentation
¶
Overview ¶
Package password hashes account passwords with argon2id and checks sign-in attempts against the stored hash. It also checks the older formats, PPanel's own PBKDF2 and the md5, sha256 and bcrypt hashes of accounts imported from other panels, so those users can still sign in and have their hash upgraded to argon2id.
Index ¶
- Constants
- func EncodePassWord(str string) string
- func IsLegacyHash(hash string) bool
- func MultiPasswordVerify(algo, salt, password, hash string) bool
- func PasswordAlgoForHash(hash string) string
- func PasswordNeedsRehash(algo, hash string) bool
- func UserColumns(plain string) map[string]any
- func VerifyPassWord(passwd, EncodePasswd string) bool
Constants ¶
const (
PasswordAlgoArgon2id = "argon2id"
)
Variables ¶
This section is empty.
Functions ¶
func EncodePassWord ¶
func IsLegacyHash ¶ added in v1.21.0
IsLegacyHash reports whether a stored hash is in one of the older formats (PPanel's PBKDF2 or an imported md5, sha256 or bcrypt hash) rather than argon2id. Such a hash is still accepted for its owner's next sign-in, which rehashes it; until then it stays weaker than the current format.
func MultiPasswordVerify ¶
func PasswordAlgoForHash ¶
func PasswordNeedsRehash ¶
func UserColumns ¶ added in v1.21.0
UserColumns returns the user-row columns that store plain as a fresh argon2id hash, for column-scoped updates.
func VerifyPassWord ¶
Types ¶
This section is empty.