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 标准参数加密解密功能入口
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
Click to show internal directories.
Click to hide internal directories.