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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
⌂ 换网址