cbc

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Crypter

type Crypter struct {
	// contains filtered or unexported fields
}

Crypter is the module responsible for performing CBC encryption/decryption for secrets It uses cipher.Block as its underlying implementation

func New

func New(c conf.Encryption, credsKeyReader io.Reader) (*Crypter, error)

New creates a new Crypter encryption module

func (*Crypter) Decrypt

func (c *Crypter) Decrypt(data []byte) (plaintext []byte, err error)

Decrypt some bytes

func (*Crypter) DecryptionKeys

func (c *Crypter) DecryptionKeys() ([]key.Key, error)

DecryptionKeys returns the encryption keys

func (*Crypter) Encrypt

func (c *Crypter) Encrypt(data []byte) (ciphertext []byte, err error)

Encrypt some bytes

type Key

type Key struct {
	Password string `json:"password",yaml:"password"`
	// contains filtered or unexported fields
}

Key stores the key used to decrypt a CBC encrypted jawn

func NewKey

func NewKey(cipherName string, hasher hash.Hash, password string) *Key

NewKey takes a hasher and a password, and return a Key struct

func (*Key) Plaintext

func (k *Key) Plaintext() string

Plaintext returns the password for this key

func (*Key) String

func (k *Key) String() string

String returns a string representation

Jump to

Keyboard shortcuts

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