cream

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package cream provides a simple interface to encrypt and decrypt streams using AES-CTR from the standard library. It does not provide any authentication or integrity checks, nor does it manage IVs. This package is intended to be used as a building block for other implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewIV

func NewIV() []byte

NewIV returns a random byte slice of 16 bytes.

func NewKey128

func NewKey128() []byte

NewKey128 returns a random byte slice of 16 bytes (for AES-128).

func NewKey192

func NewKey192() []byte

NewKey192 returns a random byte slice of 24 bytes (for AES-192).

func NewKey256

func NewKey256() []byte

NewKey256 returns a random byte slice of 32 bytes (for AES-256).

func NewRand

func NewRand(length int) []byte

NewRand returns a random byte slice of the given length.

func NewReader

func NewReader(key, iv []byte, r io.Reader) (*cipher.StreamReader, error)

NewReader returns a new cipher.StreamReader that decrypts the data read

func NewWriter

func NewWriter(key, iv []byte, w io.Writer) (*cipher.StreamWriter, error)

NewWriter returns a new cipher.StreamWriter that encrypts the data written

Types

This section is empty.

Jump to

Keyboard shortcuts

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