faceid

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(algorithm Algorithm, key string, iv string, tags []string, args map[string]string) (map[string]string, error)

func DecryptData

func DecryptData(algorithm Algorithm, key, ciphertext, iv, tag []byte) (plaintext []byte, err error)

DecryptData 使用对称密钥解密明文数据

func Encrypt

func Encrypt(algorithm Algorithm, key string, args map[string]string) (string, error)

func EncryptData

func EncryptData(algorithm Algorithm, key, plaintext, iv []byte) (ciphertext, tag []byte, err error)

EncryptData 使用对称密钥加密明文数据

func EncryptKey

func EncryptKey(algorithm Algorithm, key string) (string, error)

EncryptKey 使用非对称算法加密对称密钥

func GenerateIv

func GenerateIv(algorithm Algorithm) []byte

func GenerateKey

func GenerateKey(algorithm Algorithm) string

Types

type Algorithm

type Algorithm string
const (
	AES256CBC Algorithm = "AES-256-CBC"
	SM4GCM    Algorithm = "SM4-GCM"
)

type Encryption

type Encryption struct {
	EncryptList    []string // 加密的字段名称
	CiphertextBlob string   // 加密后的对称密钥
	Iv             string   // 初始向量
	Algorithm      string   // 加密算法
	TagList        []string // 消息摘要
}

Encryption 敏感数据加密信息

Jump to

Keyboard shortcuts

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