Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CryptionReader ¶
type CryptionReader struct {
// contains filtered or unexported fields
}
CryptionReader is a general purpose reader that applies a stream cipher on top of a regular reader.
func NewAesDecryptReader ¶
func NewCryptionReader ¶
func NewCryptionReader(stream cipher.Stream, reader io.Reader) *CryptionReader
NewCryptionReader creates a new CryptionReader instance from given stream cipher and reader.
func (CryptionReader) Read ¶
func (reader CryptionReader) Read(blocks []byte) (int, error)
Read reads blocks from underlying reader, and crypt it. The content of blocks is modified in place.
type CryptionWriter ¶
type CryptionWriter struct {
// contains filtered or unexported fields
}
Cryption writer is a general purpose of byte stream writer that applies a stream cipher on top of a regular writer.
func NewAesEncryptWriter ¶
func NewCryptionWriter ¶
func NewCryptionWriter(stream cipher.Stream, writer io.Writer) *CryptionWriter
NewCryptionWriter creates a new CryptionWriter from given stream cipher and writer.
func (CryptionWriter) Crypt ¶
func (writer CryptionWriter) Crypt(blocks []byte)
Crypt crypts the content of blocks without writing them into the underlying writer.
func (CryptionWriter) Write ¶
func (writer CryptionWriter) Write(blocks []byte) (int, error)
Write crypts the content of blocks in place, and then writes the give blocks to underlying writer.