cryptography

package
v0.0.0-...-8204e9e Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2022 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBadSeedSize = errors.New("bad seed size")
View Source
var ErrDecryptError = errors.New("failed to decrypt")
View Source
var ErrEncryptError = errors.New("failed to encrypt")

Functions

func B2SumHex

func B2SumHex(data string) string

Types

type KeyPair

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

func Keygen

func Keygen() *KeyPair

func (*KeyPair) DecryptAndVerify

func (keys *KeyPair) DecryptAndVerify(data []byte) ([]byte, []byte, error)

/ DecryptAndVerify takes a raw message and decrypts the outer message, verifies the inner message's signature and then returns the plaintext and the sender's pubkey

func (*KeyPair) LoadFile

func (keys *KeyPair) LoadFile(fname string) error

func (*KeyPair) Pubkey

func (keys *KeyPair) Pubkey() []byte

func (*KeyPair) Regen

func (keys *KeyPair) Regen()

func (*KeyPair) SaveFile

func (keys *KeyPair) SaveFile(fname string) error

func (*KeyPair) SessionID

func (keys *KeyPair) SessionID() string

func (*KeyPair) SignAndEncrypt

func (keys *KeyPair) SignAndEncrypt(recipX, data []byte) ([]byte, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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