aescipher

package
v0.0.0-...-bc76e52 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AesCipher

type AesCipher interface {
	Encrypt(ctx context.Context, plainText, secretKey, ivAes []byte, pad padding.Pad) (cipherText []byte, err error)
	Decrypt(ctx context.Context, cipherText, secretKey, ivAes []byte, pad padding.Pad) (plainText []byte, err error)
}

AesCipher 标准参数加密解密功能入口

func CBC

func CBC() AesCipher

func CFB

func CFB() AesCipher

func ECB

func ECB() AesCipher

func GCM

func GCM() AesCipher

type AesCipherByBase64

type AesCipherByBase64 interface {
	EncryptBase64(ctx context.Context, plainText, secretKey, ivAes []byte, pad padding.Pad) (cipherText string, err error)
	DecryptBase64(ctx context.Context, cipherText, secretKey, ivAes []byte, pad padding.Pad) (plainText []byte, err error)
}

func CBCBase64

func CBCBase64() AesCipherByBase64

type AesCipherByNonce

type AesCipherByNonce interface {
	EncryptWithNonce(ctx context.Context, origData, key, nonce, additional []byte) ([]byte, error)
	DecryptWithNonce(ctx context.Context, encrypted, key, nonce, additional []byte) ([]byte, error)
}

func GCMByNonce

func GCMByNonce() AesCipherByNonce

type AesCipherBySalt

type AesCipherBySalt interface {
	EncryptWithSalt(ctx context.Context, origData, key []byte, iterCount int, magic string, h func() hash.Hash, pad padding.Pad, f Cipher) ([]byte, error)
	DecryptWithSalt(ctx context.Context, encrypted, key []byte, iterCount int, magic string, h func() hash.Hash, pad padding.Pad, f Cipher) ([]byte, error)
}

func CBCBySalt

func CBCBySalt() AesCipherBySalt

type Cipher

type Cipher func(ctx context.Context, data, key, iv []byte, pad padding.Pad) ([]byte, error)

Jump to

Keyboard shortcuts

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