crypt

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2021 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AesDecrypt

func AesDecrypt(crypted, key []byte) ([]byte, error)

de

func AesEncrypt

func AesEncrypt(origData, key []byte) ([]byte, error)

en

func Decrypt

func Decrypt(encrypted []byte, key []byte) (plaintext []byte, err error)

Decrypt using the pre-generated key

func Encrypt

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

Encrypt will encrypt using the pre-generated key

func GetRandomString

func GetRandomString(l int) string

Generating Random Verification Key

func InitTls

func InitTls()

func Md5

func Md5(s string) string

Generate 32-bit MD5 strings

func New

func New(passphrase []byte, usersalt []byte) (key []byte, salt []byte, err error)

New generates a new key based on a passphrase and salt

func NewTlsClientConn

func NewTlsClientConn(conn net.Conn) net.Conn

func NewTlsServerConn

func NewTlsServerConn(conn net.Conn) net.Conn

func PKCS5Padding

func PKCS5Padding(ciphertext []byte, blockSize int) []byte

Completion when the length is insufficient

func PKCS5UnPadding

func PKCS5UnPadding(origData []byte) (error, []byte)

Remove excess

Types

type ClientHelloMsg

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

func (*ClientHelloMsg) GetServerName

func (m *ClientHelloMsg) GetServerName() string

func (*ClientHelloMsg) Unmarshal

func (m *ClientHelloMsg) Unmarshal(data []byte) bool

type CurveID

type CurveID uint16

type SignatureScheme

type SignatureScheme uint16

Jump to

Keyboard shortcuts

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