encio

package
v2.5.5 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package encio provides encrypted using AES-256-CFB input/output functions.

Encrypted container structure is the following:

|__...__|____________...
 0  ^   16   ^
    |        +-- encrypted data
    +----------- 16 bytes IV

Index

Constants

This section is empty.

Variables

View Source
var ErrDecrypt = errors.New("decryption error")

Functions

func Create

func Create(filename string) (io.WriteCloser, error)

Create creates an encrypted file container.

func NewReader

func NewReader(r io.Reader) (io.Reader, error)

NewReader wraps the ciphertext reader, and returns the reader that a plaintext can be read from.

func NewWriter

func NewWriter(w io.Writer) (io.WriteCloser, error)

NewWriter wraps the writer and returns the WriteCloser. Any information written to the writer is encrypted with the hashed machineID. WriteCloser must be closed to flush any buffered data.

func Open

func Open(filename string) (io.ReadCloser, error)

Open opens an encrypted file container.

func SetAppID

func SetAppID(s string) error

SetAppID allows to set the appID, that is used to hash the value of machineID.

Types

This section is empty.

Jump to

Keyboard shortcuts

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