nonce

package
v0.1.20 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: Unlicense Imports: 7 Imported by: 0

Documentation

Overview

Package nonce provides a simple interface for generating standard AES encryption nonces that give strong cryptographic entropy to message encryption, as well as 8 byte (64 bit) random private identifiers for references between types.

Index

Constants

View Source
const IDLen = 8
View Source
const IVLen = aes.BlockSize

IVLen is the length of Initialization Vectors used in Indra.

Variables

This section is empty.

Functions

This section is empty.

Types

type ID

type ID [IDLen]byte

ID is a value generated by the first 8 bytes truncated from the values of a hash chain that reseeds from a CSPRNG at first use and every time it generates 2^16 (65536) new ID's.

func NewID

func NewID() (t ID)

NewID returns a random 8 byte nonce to be used as identifiers.

func (ID) String added in v0.1.13

func (id ID) String() string

String encodes the ID using Based32.

type IV

type IV [IVLen]byte

IV is an Initialization Vector for AES-CTR encryption used in Indra.

func New

func New() (n IV)

New reads a nonce from a cryptographically secure random number source.

Jump to

Keyboard shortcuts

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