Documentation
¶
Overview ¶
Package encio provides input/output functions that write encrypted using AES-256-CFB data.
The encryption key is the machine identifier, unique to the operating system.
This makes file non-transferrable between devices.
Encrypted container structure is the following:
|__...__|____________...
0 ^ 16 ^
| +-- encrypted data
+----------- 16 bytes IV
Index ¶
- Variables
- func Create(filename string, opts ...Option) (io.WriteCloser, error)
- func NewReader(r io.Reader, opts ...Option) (io.Reader, error)
- func NewWriter(w io.Writer, opts ...Option) (io.WriteCloser, error)
- func Open(filename string, opts ...Option) (io.ReadCloser, error)
- func SetAppID(s string) error
- type Option
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrDecrypt = errors.New("decryption error")
View Source
var ErrEmptyID = errors.New("empty id")
Functions ¶
func Create ¶
func Create(filename string, opts ...Option) (io.WriteCloser, error)
Create creates an encrypted file container.
func NewReader ¶
NewReader wraps the ciphertext reader, and returns the reader that a plaintext can be read from.
func NewWriter ¶
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.
Types ¶
Click to show internal directories.
Click to hide internal directories.