security

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ZeroBigIntForensic added in v0.3.5

func ZeroBigIntForensic(x *big.Int)

func ZeroBytes

func ZeroBytes(data []byte)

ZeroBytes securely zeros out a byte slice to prevent sensitive data from remaining in memory. This uses explicit memory zeroing and garbage collection to help ensure the data is actually cleared.

func ZeroEcdsaKeygenLocalPartySaveData added in v0.3.5

func ZeroEcdsaKeygenLocalPartySaveData(data *ecdsakeygen.LocalPartySaveData)

ZeroEcdsaKeygenLocalPartySaveData securely zeros out sensitive fields in an ECDSA LocalPartySaveData struct. It handles big.Ints and other sensitive data within the struct.

func ZeroEddsaKeygenLocalPartySaveData added in v0.3.5

func ZeroEddsaKeygenLocalPartySaveData(data *eddsakeygen.LocalPartySaveData)

ZeroEddsaKeygenLocalPartySaveData securely zeros out sensitive fields in an EDDSA LocalPartySaveData struct.

func ZeroString

func ZeroString(s *string)

ZeroString securely clears a string reference and encourages garbage collection. Note: Go strings are immutable, so we can only clear the reference and rely on GC. This provides best-effort security by clearing the reference and forcing GC.

Types

type SecureBytes

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

SecureBytes is a wrapper for sensitive byte data that automatically zeros itself when no longer needed

func NewSecureBytes

func NewSecureBytes(data []byte) *SecureBytes

NewSecureBytes creates a new SecureBytes instance

func (*SecureBytes) Bytes

func (sb *SecureBytes) Bytes() []byte

Bytes returns the underlying byte slice (use with caution)

func (*SecureBytes) Clear

func (sb *SecureBytes) Clear()

Clear explicitly zeros the data and removes the finalizer

func (*SecureBytes) Copy

func (sb *SecureBytes) Copy() []byte

Copy returns a copy of the data

Jump to

Keyboard shortcuts

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