seclib

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: Apache-2.0 Imports: 11 Imported by: 26

Documentation

Index

Constants

View Source
const (
	DIGITS  = "23456789"
	LETTERS = "abcdefghjkmnpqrstuvwxyz"
	UPPERS  = "ABCDEFGHJKMNPRSTUVWXYZ"
	PUNC    = "@^-+="

	ALL_DIGITS  = "0123456789"
	ALL_LETTERS = "abcdefghijklmnopqrstuvwxyz"
	ALL_UPPERS  = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
	ALL_PUNC    = "~`!@#$%^&*()-_=+[]{}|:';\",./<>?"
)

Variables

View Source
var CHARS = fmt.Sprintf("%s%s%s", DIGITS, LETTERS, UPPERS)
View Source
var CHARS2 = fmt.Sprintf("%s%s%s%s", DIGITS, LETTERS, UPPERS, PUNC)
View Source
var WEAK_PASSWORDS []string = []string{}/* 129 elements not displayed */

Functions

func CleanCertificate added in v1.10.0

func CleanCertificate(cert string) string

func DecodePrivateKey added in v1.10.0

func DecodePrivateKey(keyString []byte) (*rsa.PrivateKey, error)

func GeneratePassword added in v1.10.0

func GeneratePassword(passwd string) (string, error)

func MeetComplxity added in v1.10.0

func MeetComplxity(passwd string) bool

func RandomPassword

func RandomPassword(width int) string

func RandomPassword2 added in v1.10.0

func RandomPassword2(width int) string

Types

type PasswordStrength added in v1.10.0

type PasswordStrength struct {
	Digits     int
	Lowercases int
	Uppercases int
	Punctuats  int
	Invalid    []byte
}

func AnalyzePasswordStrenth added in v1.10.0

func AnalyzePasswordStrenth(passwd string) PasswordStrength

func (PasswordStrength) Len added in v1.10.0

func (ps PasswordStrength) Len() int

func (PasswordStrength) MeetComplexity added in v1.10.0

func (ps PasswordStrength) MeetComplexity() bool

Jump to

Keyboard shortcuts

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