crypt

package
v0.0.62 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewChacha20poly1305Key

func NewChacha20poly1305Key() []byte

Types

type Crypt

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

func NewCrypt

func NewCrypt(key []byte, ads []byte) *Crypt

func (*Crypt) Decrypt

func (c *Crypt) Decrypt(encrypted []byte) ([]byte, bool)

func (*Crypt) Encrypt

func (c *Crypt) Encrypt(msg []byte) []byte

func (*Crypt) GenNonce

func (c *Crypt) GenNonce(length int) []byte

type RsaEncrypt added in v0.0.62

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

func NewRsaEncrypt added in v0.0.62

func NewRsaEncrypt(key []byte) *RsaEncrypt

func (*RsaEncrypt) Encrypt added in v0.0.62

func (re *RsaEncrypt) Encrypt(data []byte) (string, error)

type RsaKey added in v0.0.62

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

func LoadRsaKey added in v0.0.62

func LoadRsaKey(privKey []byte) *RsaKey

func NewRsaKey added in v0.0.62

func NewRsaKey(size int) *RsaKey

func (*RsaKey) Decrypt added in v0.0.62

func (rk *RsaKey) Decrypt(b64data []byte) ([]byte, error)

func (*RsaKey) GetBytes added in v0.0.62

func (rk *RsaKey) GetBytes() []byte

func (*RsaKey) GetPubKeyBytes added in v0.0.62

func (rk *RsaKey) GetPubKeyBytes() []byte

func (*RsaKey) GetRsaEncrypt added in v0.0.62

func (rk *RsaKey) GetRsaEncrypt() *RsaEncrypt

Jump to

Keyboard shortcuts

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