Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecryptFile ¶
func EncryptFile ¶
Types ¶
type StreamDecrypter ¶
type StreamDecrypter struct {
Source io.Reader
Block cipher.Block
Stream cipher.Stream
MAC hash.Hash
Meta StreamMeta
}
Stream Decrypter is a decrypter for a stream of data with authentication
func NewStreamDecrypter ¶
func NewStreamDecrypter(key, macKey []byte, meta StreamMeta, cipherText io.Reader) (*StreamDecrypter, error)
Creates a new StreamDecrypter
func (*StreamDecrypter) Authenticate ¶
func (s *StreamDecrypter) Authenticate() error
Verifies that the hash of the stream is correct. This should only be called after the processing is finished
type StreamEncrypter ¶
type StreamEncrypter struct {
Source io.Reader
Block cipher.Block
Stream cipher.Stream
MAC hash.Hash
IV []byte
}
Stream Encrypter is an encrypter for a stream of data with authentication
func NewStreamEncrypter ¶
func NewStreamEncrypter(key, macKey []byte, plainText io.Reader) (*StreamEncrypter, error)
Creates a new Stream Encrypter
func (*StreamEncrypter) Meta ¶
func (s *StreamEncrypter) Meta() StreamMeta
Returns the encrypted streams metadata for use in decrypting. This should be called after the stream is finished
type StreamMeta ¶
type StreamMeta struct {
// Initialization Vector for the cryptographic function
IV []byte
// HMAC hash of the stream
Hash []byte
}
Metadata about the encrypted stream
Click to show internal directories.
Click to hide internal directories.