security

package
v0.2.444 Latest Latest
Warning

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

Go to latest
Published: May 15, 2025 License: GPL-2.0, GPL-3.0 Imports: 26 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToSHA256

func ConvertToSHA256(string []byte) []byte

func EncryptAES

func EncryptAES(plainData, password []byte) ([]byte, error)

func GenerateKeyFromSeed

func GenerateKeyFromSeed(seed []byte) (go_crypto.PrivateKey, error)

Types

type DiffieHellmanEncrypter

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

func NewDiffieHellmanEncrypter

func NewDiffieHellmanEncrypter() (*DiffieHellmanEncrypter, error)

func (*DiffieHellmanEncrypter) ComputeSharedSecret

func (e *DiffieHellmanEncrypter) ComputeSharedSecret(clientPublicKeyBytes, salt []byte) error

func (*DiffieHellmanEncrypter) DecryptMessage

func (e *DiffieHellmanEncrypter) DecryptMessage(encryptedMessage []byte) ([]byte, error)

DecryptMessage a message using AES-GCM

func (*DiffieHellmanEncrypter) EncryptMessage

func (e *DiffieHellmanEncrypter) EncryptMessage(plaintext []byte) ([]byte, error)

Encrypt a message using AES-GCM

func (*DiffieHellmanEncrypter) PublicKey

func (e *DiffieHellmanEncrypter) PublicKey() []byte

type FileSystem

type FileSystem interface {
	ReadDir(name string) ([]fs.DirEntry, error)
	ReadFile(name string) ([]byte, error)
	Open(name string) (fs.File, error)
}

type PSK

type PSK []byte

func GeneratePSK

func GeneratePSK(codebase FileSystem, v *semver.Version) (PSK, error)

GeneratePSK is not secure TODO

func (PSK) String

func (s PSK) String() string

type PrivateKey

type PrivateKey crypto.PrivKey

Jump to

Keyboard shortcuts

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