gcm

package
v0.0.0-...-380bb19 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2016 License: Apache-2.0 Imports: 5 Imported by: 6

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

func DecryptFile(inFilePath, outFilePath string, key, iv, aad []byte) error

DecryptFile decrypts the file at the specified path using GCM.

func EncryptFile

func EncryptFile(inFilePath, outFilePath string, key, iv, aad []byte) error

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

func (*DecryptWriteCloser) Write

func (w *DecryptWriteCloser) Write(p []byte) (int, 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

func (*EncryptReader) Read

func (r *EncryptReader) Read(p []byte) (int, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL