io

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2015 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CryptionReader

type CryptionReader struct {
	// contains filtered or unexported fields
}

CryptionReader is a general purpose reader that applies a stream cipher on top of a regular reader.

func NewAesDecryptReader

func NewAesDecryptReader(key []byte, iv []byte, reader io.Reader) (*CryptionReader, error)

func NewCryptionReader

func NewCryptionReader(stream cipher.Stream, reader io.Reader) *CryptionReader

NewCryptionReader creates a new CryptionReader instance from given stream cipher and reader.

func (CryptionReader) Read

func (reader CryptionReader) Read(blocks []byte) (int, error)

Read reads blocks from underlying reader, and crypt it. The content of blocks is modified in place.

type CryptionWriter

type CryptionWriter struct {
	// contains filtered or unexported fields
}

Cryption writer is a general purpose of byte stream writer that applies a stream cipher on top of a regular writer.

func NewAesEncryptWriter

func NewAesEncryptWriter(key []byte, iv []byte, writer io.Writer) (*CryptionWriter, error)

func NewCryptionWriter

func NewCryptionWriter(stream cipher.Stream, writer io.Writer) *CryptionWriter

NewCryptionWriter creates a new CryptionWriter from given stream cipher and writer.

func (CryptionWriter) Crypt

func (writer CryptionWriter) Crypt(blocks []byte)

Crypt crypts the content of blocks without writing them into the underlying writer.

func (CryptionWriter) Write

func (writer CryptionWriter) Write(blocks []byte) (int, error)

Write crypts the content of blocks in place, and then writes the give blocks to underlying writer.

Jump to

Keyboard shortcuts

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