crypto

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AESGCMDecrypt

func AESGCMDecrypt(cipherText, key []byte) ([]byte, error)

AESGCMDecrypt 使用 AES-GCM 算法对密文进行解密

func AESGCMDecryptData

func AESGCMDecryptData(cipherText, key string) (string, error)

AESGCMDecryptData 使用 AES-GCM 算法对密文进行解密 传入 cipherText base64 string and key base64 string

func AESGCMEncrypt

func AESGCMEncrypt(plainText, key []byte) ([]byte, error)

AESGCMEncrypt 使用 AES-GCM 算法对明文进行加密

func AESGCMEncryptData

func AESGCMEncryptData(plainText, key string) (string, error)

AESGCMEncryptData 使用 AES-GCM 算法对明文进行加密 传入 plainText string and key base64 string

func EmojiAESDecrypt

func EmojiAESDecrypt(text string, options EmojiAESOptions) (string, error)

EmojiAESDecrypt Decryption Function This function decrypts AES-encrypted text encoded with emojis using the provided key.

func EmojiAESEncrypt

func EmojiAESEncrypt(text string, options EmojiAESOptions) (string, error)

EmojiAESEncrypt Emoji AES CBC TODO:

func HashPassword

func HashPassword(password string) (string, error)

HashPassword 使用 Argon2id 对密码进行 hash

func VerifyPassword

func VerifyPassword(password, encodedHash string) (match bool, err error)

VerifyPassword 验证密码的 hash 值

Types

type EmojiAESOptions

type EmojiAESOptions struct {
	Rot int
	Key string
}

Jump to

Keyboard shortcuts

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