Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // The size of the Header. HeaderSize = 4 + saltSize + blockSize // The overhead added to the file by using this library. // Overhead + len(plaintext) == len(ciphertext) Overhead = HeaderSize + hmacSize )
View Source
var DecryptErr = errors.New("message corrupt or incorrect password")
Functions ¶
func Hash ¶
Hash hashes the plaintext based on the header of the encrypted file and returns the hash Sum.
func NewDecryptReader ¶
NewDecryptReader creates an io.ReadCloser wrapping an io.Reader. It has to read the entire io.Reader to disk using a temp file so that it can hash the contents to verify that it is safe to decrypt. If the file is athenticated, the DecryptReader will be returned and the resulting bytes will be the plaintext.
func NewEncryptReader ¶
NewEncryptReader returns an io.Reader wrapping the provided io.Reader. It uses a user provided password and a random salt to derive keys. If the key is provided interactively, it should be verified since there is no recovery.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.