checkers

package
v0.0.0-...-0c294a2 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2022 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindFrequencyOfQthPassword

func FindFrequencyOfQthPassword(frequencyBlacklist map[string]int, q int) int

FindFrequencyOfQthPassword given the blacklist, find the probability of the qth password in the distribution

func FindProbabilityOfQthPassword

func FindProbabilityOfQthPassword(frequencyBlacklist map[string]int, q int) float64

FindProbabilityOfQthPassword given the blacklist, find the probability of the qth password in the distribution

func LoadBlacklist

func LoadBlacklist(filename string) []string

LoadBlacklist loads a file of high-probability password e.g. ./data/rockyou-1k.txt

func LoadFrequencyBlacklist

func LoadFrequencyBlacklist(filename string, minPasswordLength int) map[string]int

LoadFrequencyBlacklist loads a file of frequency + high-probability password e.g. ./data/rockyou-1k-withcount.txt

func PasswordProbability

func PasswordProbability(password string, frequencies map[string]int) float64

PasswordProbability calculates the probability of a password in a list

func TotalNumberOfPasswords

func TotalNumberOfPasswords(frequencies map[string]int) int

TotalNumberOfPasswords returns the total number of passwords

Types

type Checker

type Checker struct {
	TypoFrequency map[string]int
	Correctors    []string
}

Checker represents a checker service...

func NewChecker

func NewChecker(typoFrequency map[string]int, correctors []string) (checker *Checker)

NewChecker initialises the Checker

func (*Checker) CalculateTypoProbability

func (checker *Checker) CalculateTypoProbability(correctionType string) float64

CalculateTypoProbability calculate the probability that a correction is being used using typo frequencies from Chatterjee et al.

func (*Checker) CheckAlways

func (checker *Checker) CheckAlways(submittedPassword string) []string

CheckAlways checks the password and the passwords in the ball by using the given correctors

func (*Checker) CheckBlacklist

func (checker *Checker) CheckBlacklist(submittedPassword string, blacklist []string) []string

CheckBlacklist uses a blacklist of high-probability passwords. It checks the password or any password in the ball only if it isn't in the blacklist

func (*Checker) CheckOptimal

func (checker *Checker) CheckOptimal(submittedPassword string, frequencyBlacklist map[string]int, q int) []string

CheckOptimal use the given distribution of passwords and a distribution of typos to decide whether to correct the typo or not

type CombinationProbability

type CombinationProbability struct {
	Passwords   []string
	Probability float64
}

CombinationProbability is the aggregate probability of a set of passwords

func FindOptimalSubset

func FindOptimalSubset(ballProbability map[string]float64, cutoff float64) CombinationProbability

FindOptimalSubset given the ball of a password, will solve a simple optimisation problem to find the set of password such that the total aggregate probability of the set is lower than that of the qth most probable password returns the set with the highest utility

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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