Documentation ¶
Overview ¶
Package encryption manages content encryption algorithms.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(name, description string, newEncryptor EncryptorFactory)
Register registers new encryption algorithm.
func SupportedAlgorithms ¶
func SupportedAlgorithms() []string
SupportedAlgorithms returns the names of the supported encryption methods.
Types ¶
type EncryptorFactory ¶
type EncryptorFactory func(passPhrase []byte) (StreamEncryptor, error)
EncryptorFactory creates new Encryptor for given parameters.
type StreamEncryptor ¶
type StreamEncryptor interface { // EncryptStream appends the encrypted bytes corresponding to the given plaintext to a given writer. EncryptStream(plainText io.Reader, output io.Writer) error // DecryptStream appends the unencrypted bytes corresponding to the given ciphertext to a given writer. DecryptStream(cipherText io.Reader, output io.Writer) error // Overhead is the number of bytes of overhead added by EncryptStream() Overhead() int }
StreamEncryptor represents an interface for encrypting and decrypting data streams.
func CreateEncryptor ¶
func CreateEncryptor(algorithm string, passPhrase []byte) (StreamEncryptor, error)
CreateEncryptor creates an StreamEncryptor for given parameters.
func NewAES128CFB ¶
func NewAES128CFB(passPhrase []byte) (StreamEncryptor, error)
func NewAES192CFB ¶
func NewAES192CFB(passPhrase []byte) (StreamEncryptor, error)
func NewAES256CFB ¶
func NewAES256CFB(passPhrase []byte) (StreamEncryptor, error)
Click to show internal directories.
Click to hide internal directories.