security

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

type Interface interface {
	Encrypt(ctx context.Context, passphrase string, timestamp int64, plaintext string) string
	Decrypt(ctx context.Context, passphrase string, timestamp int64, ciphertext string) (string, error)
	ScryptPassword(ctx context.Context, salt, password string) string
	CompareScryptPassword(ctx context.Context, passwordHash, salt, password string) bool
	HashPassword(ctx context.Context, secretKey, password string) string
	CompareHashPassword(ctx context.Context, secretKey, hashPassword, password string) bool
}

func Init

func Init(log logger.Interface, scrypt ScryptConfig) Interface

type ScryptConfig

type ScryptConfig struct {
	Base64SignerKey     string
	Base64SaltSeperator string
	Rounds              int
	MemoryCost          int
}

Jump to

Keyboard shortcuts

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