grypto

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package grypto provides helpers for dealing with cryptography.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PasswordHash

func PasswordHash(plainPass []byte) []byte

PasswordHash returns hash of plain password in the given byte slice

func PasswordHashString

func PasswordHashString(plainPass string) []byte

PasswordHashString returns hash of plain password in the given string

func PasswordNeedsRehash

func PasswordNeedsRehash(hash []byte) bool

PasswordNeedsRehash checks if the password should be rehashed as soon as possible

func PasswordValid

func PasswordValid(hash, password []byte) bool

PasswordValid checks if provided hash

func Salt128

func Salt128() []byte

Salt128 generates 128 bits of random data.

Types

type PasswordCryptoProvider added in v1.6.0

type PasswordCryptoProvider interface {
	HashString(plain string) []byte
	Hash(plain []byte) []byte
	NeedsRehash(hash []byte) bool
	Valid(hash, plain []byte) bool
}

Directories

Path Synopsis
internal
mcf
providers

Jump to

Keyboard shortcuts

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