crypto

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2024 License: Apache-2.0 Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

func CreateAes256GcmAead added in v1.3.0

func CreateAes256GcmAead(key []byte) (cipher.AEAD, error)

func CreatePasswordHash added in v1.4.0

func CreatePasswordHash(password string, p *Argon2IDParams) (encodedHash string, err error)

func CreatePasswordHashWithDefaultParams added in v1.4.0

func CreatePasswordHashWithDefaultParams(password string) (encodedHash string, err error)

func DecryptAes256 added in v1.3.0

func DecryptAes256(ciphertextBytes []byte, aead cipher.AEAD) (string, error)

func EncryptAes256 added in v1.3.0

func EncryptAes256(plaintext string, aead cipher.AEAD) ([]byte, error)

func HashPassword

func HashPassword(password string) (string, error)

func RandomBytes added in v1.4.0

func RandomBytes(byteCount uint32) ([]byte, error)

func RandomString added in v1.4.0

func RandomString(byteCount uint32) (string, error)

func ReadRSAPrivateKey

func ReadRSAPrivateKey(filename string) (*rsa.PrivateKey, error)

func ReadRSAPublicKey

func ReadRSAPublicKey(filename string) (*rsa.PublicKey, error)

Types

type Argon2IDParams added in v1.4.0

type Argon2IDParams struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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