nacl

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2021 License: AGPL-3.0 Imports: 7 Imported by: 1

Documentation

Overview

Package nacl implements encryption and decryption using anonymous sealed boxes, depending on golang.org/x/crypto/nacl/box.

Index

Constants

View Source
const KeyLength = 32

Variables

View Source
var Anonymous crypto.Cipher = (*privateKey)(nil)

Anonymous is a convenience to encrypt anonymous sealed boxes for an explicit recipient public key, without having a private key at all.

Functions

func DecodePrivate

func DecodePrivate(hexkey string) (crypto.Cipher, error)

DecodePrivate decodes a private key from a hexadecimal string.

Since this package supports encryption and decryption, we return a crypto.Cipher instead of just a crypto.PrivateKey.

func DecodePublic

func DecodePublic(hexkey string) (crypto.PublicKey, error)

DecodePublic decodes a public key from a hexadecimal string.

func Generate

func Generate(randReader io.Reader) (crypto.Cipher, error)

Generate creates a new random private key. If randReader is nil, crypto/rand.Reader is used.

Since this package supports encryption and decryption, we return a crypto.Cipher instead of just a crypto.PrivateKey.

Types

This section is empty.

Jump to

Keyboard shortcuts

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