cfb

package
v0.0.0-...-811459a Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2017 License: ISC Imports: 6 Imported by: 0

Documentation

Overview

Package cfb supports basic cfb encryption with NO HMAC

Index

Constants

View Source
const (
	// KeySize for CFB uses the generic key size
	KeySize = generate.KeySize
	// CKeySize - Cipher key size - AES-256
	CKeySize = 32
	// MACSize is the output size of HMAC-SHA-256
	MACSize = 32
	// MKeySize - HMAC key size - HMAC-SHA-256
	MKeySize = 32
	// IVSize - 16 for cfb
	IVSize = 16
)

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(key, ciphertext []byte) ([]byte, error)

Decrypt decrypts ciphertext using the given key

func DecryptString

func DecryptString(key, ciphertext string) (string, error)

DecryptString decrypts ciphertext using the given key

func Encrypt

func Encrypt(key, plaintext []byte) ([]byte, error)

Encrypt encrypts plaintext using the given key with CTR encryption

func EncryptString

func EncryptString(key, plaintext string) (string, error)

EncryptString encrypts ciphertext using the given key

Types

type Cipher

type Cipher struct {
}

Cipher to use for implementing the BlockCipher interface

func New

func New() *Cipher

New returns a new cfb cipher

func (*Cipher) Decrypt

func (c *Cipher) Decrypt(key, ciphertext []byte) ([]byte, error)

Decrypt implements the BlockCipher interface

func (*Cipher) Encrypt

func (c *Cipher) Encrypt(key, plaintext []byte) ([]byte, error)

Encrypt implements the BlockCipher interface

func (*Cipher) KeySize

func (c *Cipher) KeySize() int

KeySize implements the BlockCipher interface

Jump to

Keyboard shortcuts

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