password

package module
v0.0.0-...-d4e3663 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: MIT Imports: 14 Imported by: 0

README

password

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 Eval

type Eval 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 (*Eval) CommonVerify

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

func (*Eval) CoreVerify

func (mpe *Eval) CoreVerify(pwd string) (*Response, error)

func (*Eval) PwnedVerify

func (mpe *Eval) 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 (*Eval) TopDictFilter

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

func (*Eval) ZxcvbnVerify

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

type Response

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

type VerifyItem

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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