Documentation ¶
Index ¶
Constants ¶
View Source
const (
// AAD (Additional authenticated data) is to be used in the GCM algorithm
AAD = "7f57c07ee9459ed704d5e403086f6503"
)
Variables ¶
This section is empty.
Functions ¶
func DecryptFile ¶
DecryptFile decrypts the file at the specified path using GCM.
func EncryptFile ¶
EncryptFile encrypts the file at the specified path using GCM.
Types ¶
type DecryptWriteCloser ¶
type DecryptWriteCloser struct {
// contains filtered or unexported fields
}
Unwraps an encrypted GCM data to the given io.Writer stream.
func NewDecryptWriteCloser ¶
func NewDecryptWriteCloser(dst io.WriteCloser, key, iv, aad []byte) (*DecryptWriteCloser, error)
func (*DecryptWriteCloser) Close ¶
func (w *DecryptWriteCloser) Close() error
type EncryptReader ¶
type EncryptReader struct {
// contains filtered or unexported fields
}
Wraps data from an io.Reader in an encrypted GCM data stream.
func NewEncryptReader ¶
func NewEncryptReader(src io.Reader, key, iv, aad []byte) (*EncryptReader, error)
func (*EncryptReader) CalculateTotalSize ¶
func (r *EncryptReader) CalculateTotalSize(size int) int
Click to show internal directories.
Click to hide internal directories.