encrypt

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CipherMethods

func CipherMethods() []string

CipherMethods 获取Cipher的所有支持方法

func Evp2Key

func Evp2Key(password string, keyLen int) (key []byte)

Evp2Key ...

func HasCipherMethod

func HasCipherMethod(method string) (ok bool)

HasCipherMethod 是否有method方法

Types

type Cipher

type Cipher struct {
	Write cipher.Stream
	Read  cipher.Stream
}

Cipher implement write and read cipher.Stream

func NewCipher

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

NewCipher new cipher method support:

aes-128-cfb
aes-192-cfb
aes-256-cfb
aes-128-ctr
aes-192-ctr
aes-256-ctr
des-cfb
bf-cfb
cast5-cfb
rc4-md5
rc4-md5-6
chacha20
chacha20-ietf

type CipherInfo

type CipherInfo struct {
	KeyLen    int
	IvLen     int
	NewStream func(key, iv []byte, isEncode bool) (cipher.Stream, error)
}

CipherInfo cipher information

func GetCipherInfo

func GetCipherInfo(method string) (info CipherInfo, ok bool)

GetCipherInfo 根据方法获得 Cipher information

Jump to

Keyboard shortcuts

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