crypto

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LegacyIterations  = 4096
	CurrentIterations = 600000
)

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(data []byte, password []byte, salt string) ([]byte, error)

Decrypt returns decrypted data.

func Encrypt

func Encrypt(data []byte, password []byte, salt string) ([]byte, error)

Encrypt returns encrypted data.

func Salt

func Salt() (string, error)

Salt returns a randomly generated salt. Derived from: https://github.com/golang/crypto/blob/eec23a3978adcfd26c29f4153eaa3e3d9b2cc53a/bcrypt/bcrypt.go#L144

func SecureCompare added in v0.1.0

func SecureCompare(a, b []byte) bool

SecureCompare performs a constant time comparison of two byte slices.

func Wipe added in v0.1.0

func Wipe(buf []byte)

Wipe fills the given byte slice with zeros to clear sensitive data from memory.

Types

This section is empty.

Jump to

Keyboard shortcuts

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