Documentation ¶
Index ¶
- Constants
- Variables
- func Hash(r io.Reader, header io.Reader, key []byte, hashFunc func() hash.Hash) ([]byte, error)
- func HashWithPassword(r io.Reader, header io.Reader, password []byte, hashFunc func() hash.Hash) ([]byte, error)
- func NewDecrypter(r io.Reader, key []byte) (io.ReadCloser, error)
- func NewDecrypterWithPassword(r io.Reader, password []byte) (io.ReadCloser, error)
- func NewEncrypter(r io.Reader, key []byte) (io.Reader, error)
- func NewEncrypterWithPassword(r io.Reader, password []byte) (io.Reader, error)
- func NewKey() ([]byte, error)
- type Version
Constants ¶
const PreferedVersion = V1
PreferedVersion is the preferred version of encryption.
Variables ¶
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.
Functions ¶
func Hash ¶
Hash will hash of plaintext based on the header of the encrypted file and returns the hash Sum.
func HashWithPassword ¶
func HashWithPassword(r io.Reader, header io.Reader, password []byte, hashFunc func() hash.Hash) ([]byte, error)
HashWithPassword will hash of plaintext based on the header of the encrypted file and returns the hash Sum.
func NewDecrypter ¶
NewDecrypter returns a decrypting reader based on the version used to encrypt.
func NewDecrypterWithPassword ¶
NewDecrypterWithPassword returns a decrypting reader based on the version used to encrypt.
func NewEncrypter ¶
NewEncrypter returns an encrypting reader using the PreferedVersion.
func NewEncrypterWithPassword ¶
NewEncrypterWithPassword returns an encrypting reader using the PreferedVersion.