utils

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2021 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Beautify

func Beautify()

Beautify : If the terminal size is enough, print the label PWD-SAFETY.

func CompositionPwdScore

func CompositionPwdScore(password string) float64

CompositionPwdScore : Scores password's composition

total = 20
There is numbers = 5
There is symbol = 5
There is uppercase = 5
There is lowercase = 5

func CountTypeElements

func CountTypeElements(input string) map[string]float64

CountTypeElements : Counts the different types in password

func CrackTime

func CrackTime(password string) float64

CrackTime : Returns the seconds needed to crack the password

func DifferentCharScore

func DifferentCharScore(password string) float64

DifferentCharScore : Scores How many different chars in relation to the length

total = 15
n = (different_chars*total)/total_chars

func Entropy

func Entropy(password string) float64

Entropy : Returns the entropy of password

func EntropyScore

func EntropyScore(password string) float64

EntropyScore : Scores Entropy's password

total = 35
< 28 bits = 3
28 - 35 bits = 8
36 - 59 bits = 20
60 - 80 bits = 24
81 - 120 bits = 28
120+ bits = 35

func FindExactly

func FindExactly(words []string, password string) bool

FindExactly : Check if the password is equal to one known password

func FindExactlyReversed

func FindExactlyReversed(words []string, password string) bool

FindExactlyReversed : Check if the password is equal to one known password reversed

func GenerateRandom

func GenerateRandom(length int) string

GenerateRandom : Generate a strong random password

func GenerateSetString

func GenerateSetString(input string) []rune

GenerateSetString : Generates a set of unique characters in the input string

func GetBlake2b256Hash

func GetBlake2b256Hash(text string) string

GetBlake2b256Hash : Return Blake2b256 hash of input

func GetBlake2b384Hash

func GetBlake2b384Hash(text string) string

GetBlake2b384Hash : Return Blake2b384 hash of input

func GetBlake2b512Hash

func GetBlake2b512Hash(text string) string

GetBlake2b512Hash : Return Blake2b512 hash of input

func GetBlake2s256Hash

func GetBlake2s256Hash(text string) string

GetBlake2s256Hash : Return Blake2s256 hash of input

func GetMD4Hash

func GetMD4Hash(text string) string

GetMD4Hash : Return MD4 hash of input

func GetMD5Hash

func GetMD5Hash(text string) string

GetMD5Hash : Return MD5 hash of input

func GetRipemd160Hash

func GetRipemd160Hash(text string) string

GetRipemd160Hash : Return Ripemd160 hash of input

func GetSHA1Hash

func GetSHA1Hash(text string) string

GetSHA1Hash : Return SHA1 hash of input

func GetSHA224Hash

func GetSHA224Hash(text string) string

GetSHA224Hash : Return SHA224 hash of input

func GetSHA256Hash

func GetSHA256Hash(text string) string

GetSHA256Hash : Return SHA256 hash of input

func GetSHA384Hash

func GetSHA384Hash(text string) string

GetSHA384Hash : Return SHA384 hash of input

func GetSHA512Hash

func GetSHA512Hash(text string) string

GetSHA512Hash : Return SHA512 hash of input

func Grader

func Grader(words [][]string, password string) float64

Grader : Return the score of the password

func HowManyDifferents

func HowManyDifferents(password string) int

HowManyDifferents : Returns the number of differents characters used in password

func HowManyTypes

func HowManyTypes(password string) int

HowManyTypes : Returns how many different types there are in the password

func IsThereLowerCase

func IsThereLowerCase(password string) bool

IsThereLowerCase : Checks if there is at least one lowercase character

func IsThereNumber

func IsThereNumber(password string) bool

IsThereNumber : Checks if there is at least one number

func IsThereSymbol

func IsThereSymbol(password string) bool

IsThereSymbol : Checks if there is at least one symbol

func IsThereUpperCase

func IsThereUpperCase(password string) bool

IsThereUpperCase : Checks if there is at least one UPPERCASE character

func KnownPwdReverseScore

func KnownPwdReverseScore(words []string, password string) float64

KnownPwdReverseScore : Scores known reversed password

total = -8
It's present = -8
There isn't = 0

func KnownPwdScore

func KnownPwdScore(words []string, password string) float64

KnownPwdScore : Scores known password

total = -18
It's present = -18
There isn't = 0

func LengthScore

func LengthScore(password string) float64

LengthScore : Scores password's length

total = 30
length<=7 = 0
length==8 = 8
length==9 = 12
10 <= length <= 15 = 20
16 <= length <= 19 = 25
20 <= length <= 24 = 28
length >=25 = 30

func ListAllFiles

func ListAllFiles(root string) []string

ListAllFiles : It lists all files in a folder

func ReadAllFiles

func ReadAllFiles(folder string) [][]string

ReadAllFiles : Read arrays of words from inputted files

func ReadInput

func ReadInput() []string

ReadInput : Reading all inputs from stdin

func ReadSingleInput

func ReadSingleInput(input string) string

ReadSingleInput : Reading one single input

func ReadWords

func ReadWords(fileInput string) []string

ReadWords : Read words from a file

func Reverse

func Reverse(s string) string

Reverse : Reverse the input string

func Round

func Round(input string) float64

Round : Round in a clever way float64 numbers

func ShowCrackTime

func ShowCrackTime(crackTime float64) string

ShowCrackTime : Beautify the crack time (from seconds to human readable string )

Types

This section is empty.

Jump to

Keyboard shortcuts

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