crypto

package
v0.0.0-...-773e18a Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RandReader = rand.Reader

	PrivateKey *rsa.PrivateKey

	// PublicKeyPKIX is the public key in PKIX, ASN.1 DER form.
	// It is a SubjectPublicKeyInfo structure.
	PublicKeyPKIX []byte

	DecryptOpts = &rsa.PKCS1v15DecryptOptions{}

	ErrCloseConn = errors.New("close connection")
)

Functions

func NewDecrypt

func NewDecrypt(secret []byte) (cipher.Stream, error)

NewDecrypt creates a new stream for decryption.

func NewDecryptReader

func NewDecryptReader(r io.Reader, secret []byte) (io.Reader, error)

NewDecrypt wraps an io.Reader with decryption using the given secret.

func NewEncrypt

func NewEncrypt(secret []byte) (cipher.Stream, error)

NewEncrypt creates a new stream for encryption.

func NewEncryptAndDecrypt

func NewEncryptAndDecrypt(secret []byte) (encrypt cipher.Stream, decrypt cipher.Stream, err error)

NewEncryptAndDecrypt creates encryption and decryption streams for a given secret.

func NewEncryptWriter

func NewEncryptWriter(w io.Writer, secret []byte) (io.Writer, error)

NewEncryptWriter wraps an io.Writer with encryption using the given secret.

Types

This section is empty.

Jump to

Keyboard shortcuts

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