encrypt

package
v0.0.0-...-067d226 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PKCS7AesKeyLen = 32 //AES算法的密钥,长度为32字节
	PKCS5AesKeyLen = 16
)

Variables

This section is empty.

Functions

func Aes128EcbPkcs5Decrypt

func Aes128EcbPkcs5Decrypt(ciphertext, key []byte) []byte

Aes128EcbPkcs5Decrypt 解密 => MYSQL AES_DECRYPT

func Aes128EcbPkcs5DecryptBase64

func Aes128EcbPkcs5DecryptBase64(msg, key string) string

Aes128EcbPkcs5DecryptBase64 解密+base64编码

func Aes128EcbPkcs5Encrypt

func Aes128EcbPkcs5Encrypt(plaintext, key []byte) []byte

Aes128EcbPkcs5Encrypt 加密 => MYSQL AES_ENCRYPT

func Aes128EcbPkcs5EncryptBase64

func Aes128EcbPkcs5EncryptBase64(msg, key string) string

Aes128EcbPkcs5EncryptBase64 加密+base64编码 => MYSQL TO_BASE64(AES_ENCRYPT)

func Aes256EcbPkcs7Decrypt

func Aes256EcbPkcs7Decrypt(ciphertext, key []byte) ([]byte, error)

Aes256EcbPkcs7Decrypt 解密

func Aes256EcbPkcs7DecryptBase64

func Aes256EcbPkcs7DecryptBase64(msg, key string) (string, error)

Aes256EcbPkcs7DecryptBase64 解密+base64编码

func Aes256EcbPkcs7Encrypt

func Aes256EcbPkcs7Encrypt(plaintext, key []byte) ([]byte, error)

Aes256EcbPkcs7Encrypt 加密

func Aes256EcbPkcs7EncryptBase64

func Aes256EcbPkcs7EncryptBase64(msg, key string) (string, error)

Aes256EcbPkcs7EncryptBase64 加密+base64编码

func AesCbcDecryptWithSalt

func AesCbcDecryptWithSalt(ciphertext, key []byte) ([]byte, error)

AesCbcDecryptWithSalt 加盐解密

func AesCbcEncryptWithSalt

func AesCbcEncryptWithSalt(plaintext, key []byte) ([]byte, error)

AesCbcEncryptWithSalt 加盐加密

func AesCbcPkcs5Decrypt

func AesCbcPkcs5Decrypt(ciphertext, key []byte) ([]byte, error)

AesCbcPkcs5Decrypt AES解密

func AesCbcPkcs5DecryptBase64

func AesCbcPkcs5DecryptBase64(ciphertext, key string) (string, error)

AesCbcPkcs5DecryptBase64 解密+base64编码

func AesCbcPkcs5Encrypt

func AesCbcPkcs5Encrypt(plaintext, key []byte) ([]byte, error)

AesCbcPkcs5Encrypt AES加密

func AesCbcPkcs5EncryptBase64

func AesCbcPkcs5EncryptBase64(plaintext, key string) (string, error)

AesCbcPkcs5EncryptBase64 加密+base64编码

func AesCbcPkcs7Decrypt

func AesCbcPkcs7Decrypt(base64EncryptMsg, encodingAesKey string) ([]byte, error)

AesCbcPkcs7Decrypt 解密

func AesCbcPkcs7DecryptBase64

func AesCbcPkcs7DecryptBase64(base64EncryptMsg, encodingAesKey string) (string, error)

AesCbcPkcs7DecryptBase64 解密

func AesCbcPkcs7Encrypt

func AesCbcPkcs7Encrypt(msg, encodingAesKey string) ([]byte, error)

AesCbcPkcs7Encrypt 加密

func AesCbcPkcs7EncryptBase64

func AesCbcPkcs7EncryptBase64(msg, encodingAesKey string) (string, error)

AesCbcPkcs7EncryptBase64 加密

func AesCfbDecryptBase64

func AesCfbDecryptBase64(base64EncryptMsg, encodingAesKey string) (string, error)

AesCfbDecryptBase64 解密

func AesCfbDecryptWithSalt

func AesCfbDecryptWithSalt(ciphertext []byte, key []byte) ([]byte, error)

AesCfbDecryptWithSalt 加盐解密

func AesCfbEncryptBase64

func AesCfbEncryptBase64(msg, encodingAesKey string) (string, error)

AesCfbEncryptBase64 加密

func AesCfbEncryptWithSalt

func AesCfbEncryptWithSalt(plaintext []byte, key []byte) ([]byte, error)

AesCfbEncryptWithSalt 加盐加密

func DesEbcDecrypt

func DesEbcDecrypt(ciphertext, key []byte) ([]byte, error)

DesEbcDecrypt 解密

func DesEbcEncrypt

func DesEbcEncrypt(plaintext, key []byte) ([]byte, error)

DesEbcEncrypt 加密

func DesEbcPkcs5DecryptBase64

func DesEbcPkcs5DecryptBase64(msg, key string) (string, error)

DesEbcPkcs5DecryptBase64 解密+Base64 兼容java默认

func DesEbcPkcs5EncryptBase64

func DesEbcPkcs5EncryptBase64(msg, key string) (string, error)

DesEbcPkcs5EncryptBase64 加密+Base64 兼容java默认

func DesEdeEcbDecrypt

func DesEdeEcbDecrypt(src, key []byte) ([]byte, error)

DesEdeEcbDecrypt 3DES解密desede-ECB

func DesEdeEcbEncrypt

func DesEdeEcbEncrypt(plaintext, key []byte) ([]byte, error)

DesEdeEcbEncrypt 3DES加密desede-ECB

func GenerateEncodingAesKey

func GenerateEncodingAesKey(key string) string

GenerateEncodingAesKey 生成43位EncodingAesKey,len(key)最好等于32

func PKCS5Padding

func PKCS5Padding(plaintext []byte, blockSize int) []byte

PKCS5Padding 填充补齐

func PKCS5UnPadding

func PKCS5UnPadding(plaintext []byte) []byte

PKCS5UnPadding 去除填充数据

func PKCS7Padding

func PKCS7Padding(plaintext []byte, blockSize int) []byte

PKCS7Padding 填充

func PKCS7UnPadding

func PKCS7UnPadding(plaintext []byte, blockSize int) ([]byte, error)

PKCS7UnPadding 去除

func PasswdPadding16

func PasswdPadding16(key []byte) []byte

PasswdPadding16 秘钥补齐

func PasswdPadding24

func PasswdPadding24(key []byte) []byte

PasswdPadding24 秘钥补齐

func PasswdPadding32

func PasswdPadding32(key []byte) []byte

PasswdPadding32 Fill 0x00 if the length of key less than 32

func PasswdPadding8

func PasswdPadding8(key []byte) []byte

PasswdPadding8 Fill 0x00 if the length of key less than 8

func ZeroPadding

func ZeroPadding(plaintext []byte, blockSize int) []byte

ZeroPadding 填充

func ZeroUnPadding

func ZeroUnPadding(plaintext []byte) []byte

ZeroUnPadding 去除

Types

This section is empty.

Jump to

Keyboard shortcuts

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