dcrypto

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const PreferedVersion = V1

PreferedVersion is the preferred version of encryption.

Variables

View Source
var MaxHeaderSize = v1.HeaderSize + 4

MaxHeaderSize is the maximum header size of all versions. This many bytes at the beginning of a file should be enough to compute a hash of a local file.

View Source
var Overhead = v1.Overhead + 4

Overhead is the overhead added by the preferred encryption library plus the version.

Functions

func Hash

func Hash(r io.Reader, header io.Reader, password []byte, hashFunc func() hash.Hash) ([]byte, error)

Hash will hash of plaintext based on the header of the encrypted file and returns the hash Sum.

func NewDecrypter

func NewDecrypter(r io.Reader, password []byte) (io.ReadCloser, error)

NewDecrypter returns a decrypting reader based on the version used to encrypt.

func NewEncrypter

func NewEncrypter(r io.Reader, password []byte) (io.Reader, error)

NewEncrypter returns an encrypting reader using the PreferedVersion.

Types

type Version

type Version uint32

Version is the version of the en/decryption library used.

const (
	V1 Version = iota
)

These are the different versions of the en/decryption library.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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