goxchange

package module
v0.0.0-...-c23c368 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2022 License: MIT Imports: 13 Imported by: 0

README

goxchange

Easy ECIES implementation in go (Elliptic Curve Integrated Encryption Scheme)

How it works

It uses Diffie-Hellman to share Elliptic curve public keys between two parties, then calculate the shared secret and proceed to communicate using symmetric encryption (chacha20 + poly1305)

It also provide an utility to wrap a standard net.Conn in order to automagically perform handshake and create a secure channel.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(ciphertext []byte, Key []byte) ([]byte, error)

func Encrypt

func Encrypt(plaintext []byte, Key []byte) ([]byte, error)

func WrapConn

func WrapConn(c net.Conn) net.Conn

Types

type PrivateKey

type PrivateKey struct {
	*ecdsa.PrivateKey
}

func (*PrivateKey) MarshalPublic

func (k *PrivateKey) MarshalPublic() []byte

func (*PrivateKey) UnmarshalPublic

func (k *PrivateKey) UnmarshalPublic(data []byte) ecdsa.PublicKey

Jump to

Keyboard shortcuts

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