crypto

package
v0.5.5-beta1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2021 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DEFAULT_RAND_ARRAY
	// random factor length
	DEFAULT_RAND_ARRAY int = 32
)

Variables

This section is empty.

Functions

func Aes

func Aes(message, key []byte) aesCrypto

Aes this func can be import Ciphertext or export Ciphertext this func will be removed(2021/10/30)

func GUnzipData

func GUnzipData(data []byte) (resData []byte, err error)

func GZipData

func GZipData(data []byte) (compressedData []byte, err error)

func Import

func Import(privateKey, publicKey []byte) (*keyPair, error)

func ImportPublic

func ImportPublic(publicKey []byte) (*keyPair, error)

func QuickAesEncrypt

func QuickAesEncrypt(message []byte) ([]byte, []byte, error)

QuickAesEncrypt dedicated to those lazy people 献给那些懒🐕

func RandArray

func RandArray() []byte

RandArray 生成一个由{DEFAULT_RAND_ARRAY}指定长度的字符串([]byte)并提取Hash 随机从Hash中提取长度与Hash值等同的一组[]byte 返回这组[]byte中的前16位 Generate a string ([]byte) with a length specified by {DEFAULT_RAND_ARRAY} and extract the Hash Randomly extract a group of []byte with the same length as the hash value from Hash Return the first 128 bits in this group of []byte

func Secp256k1

func Secp256k1() (*keyPair, error)

Secp256k1 Generate a new ecc secp256k1 key pair

func Secp256k1A

func Secp256k1A() (*ecdsa.PrivateKey, *ecdsa.PublicKey, error)

func Secp256k1Decrypt

func Secp256k1Decrypt(message []byte, privateKey *ecdsa.PrivateKey) ([]byte, error)

func Secp256k1Encrypt

func Secp256k1Encrypt(message []byte, publicKey *ecdsa.PublicKey) ([]byte, error)

func Secp256k1Signature

func Secp256k1Signature(message []byte, privateKey *ecdsa.PrivateKey) ([]byte, error)

func Secp256k1SignatureVerify

func Secp256k1SignatureVerify(message, signature []byte, publicKey *ecdsa.PublicKey) bool

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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