cipher

package
v0.3.1-rc.3 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2022 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StreamCipherMethod = map[string]struct {
	KeySize int
	Creator func(key []byte) CipherFactory
}{
	"aes-128-cfb":      newCipherObserver(16, 16, newAESCFBStream),
	"aes-192-cfb":      newCipherObserver(24, 16, newAESCFBStream),
	"aes-256-cfb":      newCipherObserver(32, 16, newAESCFBStream),
	"aes-128-ctr":      newCipherObserver(16, 16, newAESCTRStream),
	"aes-192-ctr":      newCipherObserver(24, 16, newAESCTRStream),
	"aes-256-ctr":      newCipherObserver(32, 16, newAESCTRStream),
	"aes-128-ofb":      newCipherObserver(16, 16, newAESOFBStream),
	"aes-192-ofb":      newCipherObserver(24, 16, newAESOFBStream),
	"aes-256-ofb":      newCipherObserver(32, 16, newAESOFBStream),
	"des-cfb":          newCipherObserver(8, 8, newDESStream),
	"bf-cfb":           newCipherObserver(16, 8, newBlowFishStream),
	"cast5-cfb":        newCipherObserver(16, 8, newCast5Stream),
	"rc4-md5":          newCipherObserver(16, 16, newRC4MD5Stream),
	"rc4-md5-6":        newCipherObserver(16, 6, newRC4MD5Stream),
	"chacha20":         newCipherObserver(chacha20.KeySize, 8, newChaCha20Stream),
	"chacha20-ietf":    newCipherObserver(chacha20.KeySize, chacha20.NonceSize, newChaCha20Stream),
	"salsa20":          newCipherObserver(32, 8, newSalsa20Stream),
	"camellia-128-cfb": newCipherObserver(16, 16, newCamelliaStream),
	"camellia-192-cfb": newCipherObserver(24, 16, newCamelliaStream),
	"camellia-256-cfb": newCipherObserver(32, 16, newCamelliaStream),
	"idea-cfb":         newCipherObserver(16, 8, newIdeaStream),
	"rc2-cfb":          newCipherObserver(16, 8, newRC2Stream),
	"seed-cfb":         newCipherObserver(16, 8, newSeedStream),
	"rc4":              newCipherObserver(16, 0, newRC4Stream),
	"none":             newCipherObserver(16, 0, newNoneStream),
}

Functions

This section is empty.

Types

type Cipher

type Cipher struct {
	core.Cipher
	// contains filtered or unexported fields
}

func NewCipher

func NewCipher(method, password string) (*Cipher, error)

func (*Cipher) IVSize

func (c *Cipher) IVSize() int

func (*Cipher) Key

func (c *Cipher) Key() []byte

type CipherFactory

type CipherFactory interface {
	IVSize() int
	EncryptStream(iv []byte) (cipher.Stream, error)
	DecryptStream(iv []byte) (cipher.Stream, error)
}

type NoneStream

type NoneStream struct{}

func (NoneStream) XORKeyStream

func (NoneStream) XORKeyStream(dst, src []byte)

Directories

Path Synopsis
Package camellia implements the camellia block cipher.
Package camellia implements the camellia block cipher.
Package idea implements the IDEA block cipher
Package idea implements the IDEA block cipher

Jump to

Keyboard shortcuts

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