ecies

package
v0.0.0-...-dfba71b Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2020 License: BSD-2-Clause, MPL-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package ecies implements the Elliptic Curve Integrated Encryption Scheme (ECIES).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(group kyber.Group, private kyber.Scalar, ctx []byte, hash func() hash.Hash) ([]byte, error)

Decrypt first computes a shared DH key using the received ephemeral elliptic curve point (stored in the first part of ctx), then HKDF-derives a symmetric key (and nonce) from that, and finally uses these values to decrypt the given ciphertext (stored in the second part of ctx) via AES-GCM. If the hash input parameter is nil then SHA256 is used as a default. Decrypt returns the plaintext message or an error.

func Encrypt

func Encrypt(group kyber.Group, public kyber.Point, message []byte, hash func() hash.Hash) ([]byte, error)

Encrypt first computes a shared DH key using the given public key, then HKDF-derives a symmetric key (and nonce) from that, and finally uses these values to encrypt the given message via AES-GCM. If the hash input parameter is nil then SHA256 is used as a default. Encrypt returns a byte slice containing the ephemeral elliptic curve point of the DH key exchange and the ciphertext or an error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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