verifier

package
v0.0.0-...-c65d85c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	L33TMatcherName = "l33t"
)

Variables

View Source
var (
	ErrStringEmpty = errors.New("Empty password string error")
	ErrNonHTTPOk   = errors.New("Non HTTP OK in API Call")
)
View Source
var Top1000Pwd = `` /* 7408-byte string literal not displayed */

Functions

This section is empty.

Types

type CommonStrategy

type CommonStrategy struct {
	IsDigit   bool `json:"is_digit"`   // 是否包含数字
	IsUpper   bool `json:"is_upper"`   // 是否包含大写字母
	IsLower   bool `json:"is_lower"`   // 是否包含小写字母
	IsSpecial bool `json:"is_special"` // 是否包含特殊符号
	PwdLength bool `json:"pwd_length"`
}

常规策略

type MPasswordEval

type MPasswordEval struct {
	HTTPClient *http.Client
	DictMap    map[string]int
	Pwned      bool //破解历史校验
	Zxcvbn     bool //zxcvbn校验
	TopDict    bool //常用字典校验
	Digit      bool //是否包含数字
	Upper      bool //是否包含大写字母
	Lower      bool //是否包含小写字母
	Special    bool //是否包含特殊符号
	Length     int  //密码长度
}

func (*MPasswordEval) CommonVerify

func (mpe *MPasswordEval) CommonVerify(pwd string) *CommonStrategy

func (*MPasswordEval) CoreVerify

func (mpe *MPasswordEval) CoreVerify(pwd string) (*MpasswordEvalResponse, error)

func (*MPasswordEval) PwnedVerify

func (mpe *MPasswordEval) PwnedVerify(pwd string) (bool, string, error)

PwnedVerify 原说明如下 In order to protect the value of the source password being searched for, Pwned Passwords also implements a k-Anonymity model that allows a password to be searched for by partial hash. This allows the first 5 characters of a SHA-1 password hash (not case-sensitive) to be passed to the API (testable by clicking here): GET https://api.pwnedpasswords.com/range/{first 5 hash chars}

func (*MPasswordEval) TopDictFilter

func (mpe *MPasswordEval) TopDictFilter(pwd string) (bool, string, error)

func (*MPasswordEval) ZxcvbnVerify

func (mpe *MPasswordEval) ZxcvbnVerify(pwd string) (bool, string, error)

type MpasswordEvalResponse

type MpasswordEvalResponse struct {
	VerifyItem *MpasswordEvalResponseItem `json:"verify_item"`
	Message    string                     `json:"message"`
	Status     bool                       `json:"status"`
}

type MpasswordEvalResponseItem

type MpasswordEvalResponseItem struct {
	Zxcv           bool           `json:"zxcv"`
	Pwned          bool           `json:"pwned"`
	TopDict        bool           `json:"top_dict"`
	CommonStrategy CommonStrategy `json:"common_strategy"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL