crypto

package
v0.0.0-...-58a2b35 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package crypto provides aes 加解密

Package crypto provides 生成加解密算法

Package crypto provides des 加解密

Package crypto provides 填充算法

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PKCS5Padding

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

func PKCS5UnPadding

func PKCS5UnPadding(origData []byte) []byte

Types

type AESCrypter

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

func (*AESCrypter) Decrypt

func (cpt *AESCrypter) Decrypt(src []byte) ([]byte, error)

func (*AESCrypter) Encrypt

func (cpt *AESCrypter) Encrypt(src []byte) ([]byte, error)

type Crypter

type Crypter interface {
	Encrypt([]byte) ([]byte, error)
	Decrypt([]byte) ([]byte, error)
}

func NewCrypter

func NewCrypter(kind string, key []byte) (Crypter, error)

type DESCrypter

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

func (*DESCrypter) Decrypt

func (cpt *DESCrypter) Decrypt(src []byte) ([]byte, error)

func (*DESCrypter) Encrypt

func (cpt *DESCrypter) Encrypt(src []byte) ([]byte, error)

type DH

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

func NewDH

func NewDH() (*DH, error)

func (*DH) ComputeKey

func (dh *DH) ComputeKey(public string) ([]byte, error)

func (*DH) PrivKey

func (dh *DH) PrivKey() string

Jump to

Keyboard shortcuts

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