xcrypto

package
v0.7.16 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2022 License: MIT Imports: 16 Imported by: 2

README

xcrypto

import "github.com/fufuok/utils/xcrypto"

Index

func AesCBCDeB58

func AesCBCDeB58(s string, key []byte) []byte

AesCBCDeB58 解密, ZerosPadding

func AesCBCDeB64

func AesCBCDeB64(s string, key []byte) []byte

AesCBCDeB64 解密, ZerosPadding

func AesCBCDeHex

func AesCBCDeHex(s string, key []byte) []byte

AesCBCDeHex 解密, ZerosPadding

func AesCBCDePKCS7B58

func AesCBCDePKCS7B58(s string, key []byte) []byte

AesCBCDePKCS7B58 解密, Pkcs7Padding

func AesCBCDePKCS7B64

func AesCBCDePKCS7B64(s string, key []byte) []byte

AesCBCDePKCS7B64 解密, Pkcs7Padding

func AesCBCDePKCS7Hex

func AesCBCDePKCS7Hex(s string, key []byte) []byte

AesCBCDePKCS7Hex 解密, Pkcs7Padding

func AesCBCDePKCS7StringB58

func AesCBCDePKCS7StringB58(s string, key []byte) string

AesCBCDePKCS7StringB58 解密, Pkcs7Padding

func AesCBCDePKCS7StringB64

func AesCBCDePKCS7StringB64(s string, key []byte) string

AesCBCDePKCS7StringB64 解密, Pkcs7Padding

func AesCBCDePKCS7StringHex

func AesCBCDePKCS7StringHex(s string, key []byte) string

AesCBCDePKCS7StringHex 解密, Pkcs7Padding

func AesCBCDeStringB58

func AesCBCDeStringB58(s string, key []byte) string

AesCBCDeStringB58 解密, ZerosPadding

func AesCBCDeStringB64

func AesCBCDeStringB64(s string, key []byte) string

AesCBCDeStringB64 解密, ZerosPadding

func AesCBCDeStringHex

func AesCBCDeStringHex(s string, key []byte) string

AesCBCDeStringHex 解密, ZerosPadding

func AesCBCDecrypt

func AesCBCDecrypt(asPKCS7 bool, ciphertext, key []byte, ivs ...[]byte) (plaintext []byte)

AesCBCDecrypt AES-CBC 解密

func AesCBCDecryptE

func AesCBCDecryptE(asPKCS7 bool, ciphertext, key []byte, ivs ...[]byte) ([]byte, error)

AesCBCDecryptE AES-CBC 解密, 密码分组链接模式 (Cipher Block Chaining (CBC))

func AesCBCEnB58

func AesCBCEnB58(b, key []byte) string

AesCBCEnB58 加密, ZerosPadding

func AesCBCEnB64

func AesCBCEnB64(b, key []byte) string

AesCBCEnB64 加密, ZerosPadding

func AesCBCEnHex

func AesCBCEnHex(b, key []byte) string

AesCBCEnHex 加密, ZerosPadding

func AesCBCEnPKCS7B58

func AesCBCEnPKCS7B58(b, key []byte) string

AesCBCEnPKCS7B58 加密, Pkcs7Padding

func AesCBCEnPKCS7B64

func AesCBCEnPKCS7B64(b, key []byte) string

AesCBCEnPKCS7B64 加密, Pkcs7Padding

func AesCBCEnPKCS7Hex

func AesCBCEnPKCS7Hex(b, key []byte) string

AesCBCEnPKCS7Hex 加密, Pkcs7Padding

func AesCBCEnPKCS7StringB58

func AesCBCEnPKCS7StringB58(s string, key []byte) string

AesCBCEnPKCS7StringB58 加密, Pkcs7Padding

func AesCBCEnPKCS7StringB64

func AesCBCEnPKCS7StringB64(s string, key []byte) string

AesCBCEnPKCS7StringB64 加密, Pkcs7Padding

func AesCBCEnPKCS7StringHex

func AesCBCEnPKCS7StringHex(s string, key []byte) string

AesCBCEnPKCS7StringHex 加密, Pkcs7Padding

func AesCBCEnStringB58

func AesCBCEnStringB58(s string, key []byte) string

AesCBCEnStringB58 加密, ZerosPadding

func AesCBCEnStringB64

func AesCBCEnStringB64(s string, key []byte) string

AesCBCEnStringB64 加密, ZerosPadding

func AesCBCEnStringHex

func AesCBCEnStringHex(s string, key []byte) string

AesCBCEnStringHex 加密, ZerosPadding

func AesCBCEncrypt

func AesCBCEncrypt(asPKCS7 bool, plaintext, key []byte, ivs ...[]byte) (ciphertext []byte)

AesCBCEncrypt AES-CBC 加密

func AesCBCEncryptE

func AesCBCEncryptE(asPKCS7 bool, plaintext, key []byte, ivs ...[]byte) ([]byte, error)

AesCBCEncryptE AES-CBC 加密, 密码分组链接模式 (Cipher Block Chaining (CBC)) key 长度分别是 16 (AES-128), 24 (AES-192?), 32 (AES-256?) asPKCS7: false (ZerosPadding), true (Pkcs7Padding)

func AesGCMDeB58

func AesGCMDeB58(s string, key, nonce []byte) []byte

AesGCMDeB58 解密

func AesGCMDeB64

func AesGCMDeB64(s string, key, nonce []byte) []byte

AesGCMDeB64 解密

func AesGCMDeHex

func AesGCMDeHex(s string, key, nonce []byte) []byte

AesGCMDeHex 解密

func AesGCMDeStringB58

func AesGCMDeStringB58(s string, key, nonce []byte) string

AesGCMDeStringB58 解密

func AesGCMDeStringB64

func AesGCMDeStringB64(s string, key, nonce []byte) string

AesGCMDeStringB64 解密

func AesGCMDeStringHex

func AesGCMDeStringHex(s string, key, nonce []byte) string

AesGCMDeStringHex 解密

func AesGCMDecrypt

func AesGCMDecrypt(ciphertext, key, nonce []byte) (plaintext []byte)

AesGCMDecrypt AES-GCM 解密

func AesGCMDecryptWithNonce

func AesGCMDecryptWithNonce(ciphertext, key, nonce, additionalData []byte) ([]byte, error)

AesGCMDecryptWithNonce AES-GCM 解密, (Galois/Counter Mode (GCM))

func AesGCMEnB58

func AesGCMEnB58(b, key []byte) (string, []byte)

AesGCMEnB58 加密

func AesGCMEnB64

func AesGCMEnB64(b, key []byte) (string, []byte)

AesGCMEnB64 加密

func AesGCMEnHex

func AesGCMEnHex(b, key []byte) (string, []byte)

AesGCMEnHex 加密

func AesGCMEnStringB58

func AesGCMEnStringB58(s string, key []byte) (string, []byte)

AesGCMEnStringB58 加密

func AesGCMEnStringB64

func AesGCMEnStringB64(s string, key []byte) (string, []byte)

AesGCMEnStringB64 加密

func AesGCMEnStringHex

func AesGCMEnStringHex(s string, key []byte) (string, []byte)

AesGCMEnStringHex 加密

func AesGCMEncrypt

func AesGCMEncrypt(plaintext, key []byte) (ciphertext []byte, nonce []byte)

AesGCMEncrypt AES-GCM 加密

func AesGCMEncryptWithNonce

func AesGCMEncryptWithNonce(plaintext, key, nonce, additionalData []byte) ([]byte, []byte, error)

AesGCMEncryptWithNonce AES-GCM 加密, (Galois/Counter Mode (GCM)) key 长度分别是 16 (AES-128), 32 (AES-256)

func Decrypt

func Decrypt(value, secret string) string

Decrypt 解密

func DesCBCDeB58

func DesCBCDeB58(s string, key []byte) []byte

DesCBCDeB58 解密, ZerosPadding

func DesCBCDeB64

func DesCBCDeB64(s string, key []byte) []byte

DesCBCDeB64 解密, ZerosPadding

func DesCBCDeHex

func DesCBCDeHex(s string, key []byte) []byte

DesCBCDeHex 解密, ZerosPadding

func DesCBCDePKCS7B58

func DesCBCDePKCS7B58(s string, key []byte) []byte

DesCBCDePKCS7B58 解密, Pkcs7Padding

func DesCBCDePKCS7B64

func DesCBCDePKCS7B64(s string, key []byte) []byte

DesCBCDePKCS7B64 解密, Pkcs7Padding

func DesCBCDePKCS7Hex

func DesCBCDePKCS7Hex(s string, key []byte) []byte

DesCBCDePKCS7Hex 解密, Pkcs7Padding

func DesCBCDePKCS7StringB58

func DesCBCDePKCS7StringB58(s string, key []byte) string

DesCBCDePKCS7StringB58 解密, Pkcs7Padding

func DesCBCDePKCS7StringB64

func DesCBCDePKCS7StringB64(s string, key []byte) string

DesCBCDePKCS7StringB64 解密, Pkcs7Padding

func DesCBCDePKCS7StringHex

func DesCBCDePKCS7StringHex(s string, key []byte) string

DesCBCDePKCS7StringHex 解密, Pkcs7Padding

func DesCBCDeStringB58

func DesCBCDeStringB58(s string, key []byte) string

DesCBCDeStringB58 解密, ZerosPadding

func DesCBCDeStringB64

func DesCBCDeStringB64(s string, key []byte) string

DesCBCDeStringB64 解密, ZerosPadding

func DesCBCDeStringHex

func DesCBCDeStringHex(s string, key []byte) string

DesCBCDeStringHex 解密, ZerosPadding

func DesCBCDecrypt

func DesCBCDecrypt(asPKCS7 bool, ciphertext, key []byte, ivs ...[]byte) (plaintext []byte)

DesCBCDecrypt AES-CBC 解密

func DesCBCDecryptE

func DesCBCDecryptE(asPKCS7 bool, ciphertext, key []byte, ivs ...[]byte) ([]byte, error)

DesCBCDecryptE DES-CBC 解密, 密码分组链接模式 (Cipher Block Chaining (CBC))

func DesCBCEnB58

func DesCBCEnB58(b, key []byte) string

DesCBCEnB58 加密, ZerosPadding

func DesCBCEnB64

func DesCBCEnB64(b, key []byte) string

DesCBCEnB64 加密, ZerosPadding

func DesCBCEnHex

func DesCBCEnHex(b, key []byte) string

DesCBCEnHex 加密, ZerosPadding

func DesCBCEnPKCS7B58

func DesCBCEnPKCS7B58(b, key []byte) string

DesCBCEnPKCS7B58 加密, Pkcs7Padding

func DesCBCEnPKCS7B64

func DesCBCEnPKCS7B64(b, key []byte) string

DesCBCEnPKCS7B64 加密, Pkcs7Padding

func DesCBCEnPKCS7Hex

func DesCBCEnPKCS7Hex(b, key []byte) string

DesCBCEnPKCS7Hex 加密, Pkcs7Padding

func DesCBCEnPKCS7StringB58

func DesCBCEnPKCS7StringB58(s string, key []byte) string

DesCBCEnPKCS7StringB58 加密, Pkcs7Padding

func DesCBCEnPKCS7StringB64

func DesCBCEnPKCS7StringB64(s string, key []byte) string

DesCBCEnPKCS7StringB64 加密, Pkcs7Padding

func DesCBCEnPKCS7StringHex

func DesCBCEnPKCS7StringHex(s string, key []byte) string

DesCBCEnPKCS7StringHex 加密, Pkcs7Padding

func DesCBCEnStringB58

func DesCBCEnStringB58(s string, key []byte) string

DesCBCEnStringB58 加密, ZerosPadding

func DesCBCEnStringB64

func DesCBCEnStringB64(s string, key []byte) string

DesCBCEnStringB64 加密, ZerosPadding

func DesCBCEnStringHex

func DesCBCEnStringHex(s string, key []byte) string

DesCBCEnStringHex 加密, ZerosPadding

func DesCBCEncrypt

func DesCBCEncrypt(asPKCS7 bool, plaintext, key []byte, ivs ...[]byte) (ciphertext []byte)

DesCBCEncrypt AES-CBC 加密

func DesCBCEncryptE

func DesCBCEncryptE(asPKCS7 bool, plaintext, key []byte, ivs ...[]byte) ([]byte, error)

DesCBCEncryptE DES-CBC 加密, 密码分组链接模式 (Cipher Block Chaining (CBC)) key 长度固定为 8 asPKCS7: false (ZerosPadding), true (Pkcs7Padding)

func Encrypt

func Encrypt(value, secret string) string

Encrypt 加密 (密钥取 32 位 MD5, AES-CBC, base58)

func GCMDeB58

func GCMDeB58(s string, key []byte) []byte

GCMDeB58 解密

func GCMDeB64

func GCMDeB64(s string, key []byte) []byte

GCMDeB64 解密

func GCMDeHex

func GCMDeHex(s string, key []byte) []byte

GCMDeHex 解密

func GCMDeStringB58

func GCMDeStringB58(s string, key []byte) string

GCMDeStringB58 解密

func GCMDeStringB64

func GCMDeStringB64(s string, key []byte) string

GCMDeStringB64 解密

func GCMDeStringHex

func GCMDeStringHex(s string, key []byte) string

GCMDeStringHex 解密

func GCMDecrypt

func GCMDecrypt(encrypted, key []byte) ([]byte, error)

GCMDecrypt AES-GCM 解密

func GCMEnB58

func GCMEnB58(b, key []byte) string

GCMEnB58 加密

func GCMEnB64

func GCMEnB64(b, key []byte) string

GCMEnB64 加密

func GCMEnHex

func GCMEnHex(b, key []byte) string

GCMEnHex 加密

func GCMEnStringB58

func GCMEnStringB58(s string, key []byte) string

GCMEnStringB58 加密

func GCMEnStringB64

func GCMEnStringB64(s string, key []byte) string

GCMEnStringB64 加密

func GCMEnStringHex

func GCMEnStringHex(s string, key []byte) string

GCMEnStringHex 加密

func GCMEncrypt

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

GCMEncrypt AES-GCM 加密

func GenRSAKey

func GenRSAKey(bits int) (publicKey, privateKey []byte)

GenRSAKey 生成 RSA 密钥对 openssl genrsa -out rsa_private_key.pem 1024 openssl rsa -in rsa_private_key.pem -pubout -out rsa_public_key.pem

func GetenvDecrypt

func GetenvDecrypt(key string, secret string) string

GetenvDecrypt 解密环境变量参数(string)

func Padding

func Padding(b []byte, bSize int, pkcs7 bool) []byte

Padding 填充

func ParsePrivateKey

func ParsePrivateKey(privateKey []byte) (priv *rsa.PrivateKey, err error)

ParsePrivateKey parses an RSA private key in PKCS #1, ASN.1 DER form.

func ParsePublicKey

func ParsePublicKey(publicKey []byte) (pub *rsa.PublicKey, err error)

ParsePublicKey parses a public key in PKIX, ASN.1 DER form.

func RSADecrypt

func RSADecrypt(ciphertext, privateKey []byte) ([]byte, error)

RSADecrypt 私钥解密

func RSAEncrypt

func RSAEncrypt(plaintext, publicKey []byte) ([]byte, error)

RSAEncrypt 公钥加密

func RSASign

func RSASign(data, privateKey []byte) ([]byte, error)

RSASign 私钥签名

func RSASignVerify

func RSASignVerify(data, publicKey, sig []byte) error

RSASignVerify 公钥验证签名

func SetenvEncrypt

func SetenvEncrypt(key, value, secret string) (string, error)

SetenvEncrypt 加密并设置环境变量(string)

func UnPadding

func UnPadding(b []byte, pkcs7 bool) []byte

UnPadding 去除填充

func XOR

func XOR(src, key []byte) []byte

XOR 异或加解密

func XORDeB58

func XORDeB58(s string, key []byte) []byte

XORDeB58 解密

func XORDeB64

func XORDeB64(s string, key []byte) []byte

XORDeB64 解密

func XORDeHex

func XORDeHex(s string, key []byte) []byte

XORDeHex 解密

func XORDeStringB58

func XORDeStringB58(s string, key []byte) string

XORDeStringB58 解密

func XORDeStringB64

func XORDeStringB64(s string, key []byte) string

XORDeStringB64 解密

func XORDeStringHex

func XORDeStringHex(s string, key []byte) string

XORDeStringHex 解密

func XORE

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

XORE RC4 加密算法(异或运算), 简单加解密, 不够安全 key 长度是 1-256

func XOREnB58

func XOREnB58(b, key []byte) string

XOREnB58 加密

func XOREnB64

func XOREnB64(b, key []byte) string

XOREnB64 加密

func XOREnHex

func XOREnHex(b, key []byte) string

XOREnHex 加密

func XOREnStringB58

func XOREnStringB58(s string, key []byte) string

XOREnStringB58 加密

func XOREnStringB64

func XOREnStringB64(s string, key []byte) string

XOREnStringB64 加密

func XOREnStringHex

func XOREnStringHex(s string, key []byte) string

XOREnStringHex 加密

Generated by gomarkdoc

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AesCBCDeB58

func AesCBCDeB58(s string, key []byte) []byte

AesCBCDeB58 解密, ZerosPadding

func AesCBCDeB64

func AesCBCDeB64(s string, key []byte) []byte

AesCBCDeB64 解密, ZerosPadding

func AesCBCDeHex

func AesCBCDeHex(s string, key []byte) []byte

AesCBCDeHex 解密, ZerosPadding

func AesCBCDePKCS7B58

func AesCBCDePKCS7B58(s string, key []byte) []byte

AesCBCDePKCS7B58 解密, Pkcs7Padding

func AesCBCDePKCS7B64

func AesCBCDePKCS7B64(s string, key []byte) []byte

AesCBCDePKCS7B64 解密, Pkcs7Padding

func AesCBCDePKCS7Hex

func AesCBCDePKCS7Hex(s string, key []byte) []byte

AesCBCDePKCS7Hex 解密, Pkcs7Padding

func AesCBCDePKCS7StringB58

func AesCBCDePKCS7StringB58(s string, key []byte) string

AesCBCDePKCS7StringB58 解密, Pkcs7Padding

func AesCBCDePKCS7StringB64

func AesCBCDePKCS7StringB64(s string, key []byte) string

AesCBCDePKCS7StringB64 解密, Pkcs7Padding

func AesCBCDePKCS7StringHex

func AesCBCDePKCS7StringHex(s string, key []byte) string

AesCBCDePKCS7StringHex 解密, Pkcs7Padding

func AesCBCDeStringB58

func AesCBCDeStringB58(s string, key []byte) string

AesCBCDeStringB58 解密, ZerosPadding

func AesCBCDeStringB64

func AesCBCDeStringB64(s string, key []byte) string

AesCBCDeStringB64 解密, ZerosPadding

func AesCBCDeStringHex

func AesCBCDeStringHex(s string, key []byte) string

AesCBCDeStringHex 解密, ZerosPadding

func AesCBCDecrypt

func AesCBCDecrypt(asPKCS7 bool, ciphertext, key []byte, ivs ...[]byte) (plaintext []byte)

AesCBCDecrypt AES-CBC 解密

func AesCBCDecryptE

func AesCBCDecryptE(asPKCS7 bool, ciphertext, key []byte, ivs ...[]byte) ([]byte, error)

AesCBCDecryptE AES-CBC 解密, 密码分组链接模式 (Cipher Block Chaining (CBC))

func AesCBCEnB58

func AesCBCEnB58(b, key []byte) string

AesCBCEnB58 加密, ZerosPadding

func AesCBCEnB64

func AesCBCEnB64(b, key []byte) string

AesCBCEnB64 加密, ZerosPadding

func AesCBCEnHex

func AesCBCEnHex(b, key []byte) string

AesCBCEnHex 加密, ZerosPadding

func AesCBCEnPKCS7B58

func AesCBCEnPKCS7B58(b, key []byte) string

AesCBCEnPKCS7B58 加密, Pkcs7Padding

func AesCBCEnPKCS7B64

func AesCBCEnPKCS7B64(b, key []byte) string

AesCBCEnPKCS7B64 加密, Pkcs7Padding

func AesCBCEnPKCS7Hex

func AesCBCEnPKCS7Hex(b, key []byte) string

AesCBCEnPKCS7Hex 加密, Pkcs7Padding

func AesCBCEnPKCS7StringB58

func AesCBCEnPKCS7StringB58(s string, key []byte) string

AesCBCEnPKCS7StringB58 加密, Pkcs7Padding

func AesCBCEnPKCS7StringB64

func AesCBCEnPKCS7StringB64(s string, key []byte) string

AesCBCEnPKCS7StringB64 加密, Pkcs7Padding

func AesCBCEnPKCS7StringHex

func AesCBCEnPKCS7StringHex(s string, key []byte) string

AesCBCEnPKCS7StringHex 加密, Pkcs7Padding

func AesCBCEnStringB58

func AesCBCEnStringB58(s string, key []byte) string

AesCBCEnStringB58 加密, ZerosPadding

func AesCBCEnStringB64

func AesCBCEnStringB64(s string, key []byte) string

AesCBCEnStringB64 加密, ZerosPadding

func AesCBCEnStringHex

func AesCBCEnStringHex(s string, key []byte) string

AesCBCEnStringHex 加密, ZerosPadding

func AesCBCEncrypt

func AesCBCEncrypt(asPKCS7 bool, plaintext, key []byte, ivs ...[]byte) (ciphertext []byte)

AesCBCEncrypt AES-CBC 加密

func AesCBCEncryptE

func AesCBCEncryptE(asPKCS7 bool, plaintext, key []byte, ivs ...[]byte) ([]byte, error)

AesCBCEncryptE AES-CBC 加密, 密码分组链接模式 (Cipher Block Chaining (CBC)) key 长度分别是 16 (AES-128), 24 (AES-192?), 32 (AES-256?) asPKCS7: false (ZerosPadding), true (Pkcs7Padding)

func AesGCMDeB58

func AesGCMDeB58(s string, key, nonce []byte) []byte

AesGCMDeB58 解密

func AesGCMDeB64

func AesGCMDeB64(s string, key, nonce []byte) []byte

AesGCMDeB64 解密

func AesGCMDeHex

func AesGCMDeHex(s string, key, nonce []byte) []byte

AesGCMDeHex 解密

func AesGCMDeStringB58

func AesGCMDeStringB58(s string, key, nonce []byte) string

AesGCMDeStringB58 解密

func AesGCMDeStringB64

func AesGCMDeStringB64(s string, key, nonce []byte) string

AesGCMDeStringB64 解密

func AesGCMDeStringHex

func AesGCMDeStringHex(s string, key, nonce []byte) string

AesGCMDeStringHex 解密

func AesGCMDecrypt

func AesGCMDecrypt(ciphertext, key, nonce []byte) (plaintext []byte)

AesGCMDecrypt AES-GCM 解密

func AesGCMDecryptWithNonce

func AesGCMDecryptWithNonce(ciphertext, key, nonce, additionalData []byte) ([]byte, error)

AesGCMDecryptWithNonce AES-GCM 解密, (Galois/Counter Mode (GCM))

func AesGCMEnB58

func AesGCMEnB58(b, key []byte) (string, []byte)

AesGCMEnB58 加密

func AesGCMEnB64

func AesGCMEnB64(b, key []byte) (string, []byte)

AesGCMEnB64 加密

func AesGCMEnHex

func AesGCMEnHex(b, key []byte) (string, []byte)

AesGCMEnHex 加密

func AesGCMEnStringB58

func AesGCMEnStringB58(s string, key []byte) (string, []byte)

AesGCMEnStringB58 加密

func AesGCMEnStringB64

func AesGCMEnStringB64(s string, key []byte) (string, []byte)

AesGCMEnStringB64 加密

func AesGCMEnStringHex

func AesGCMEnStringHex(s string, key []byte) (string, []byte)

AesGCMEnStringHex 加密

func AesGCMEncrypt

func AesGCMEncrypt(plaintext, key []byte) (ciphertext []byte, nonce []byte)

AesGCMEncrypt AES-GCM 加密

func AesGCMEncryptWithNonce

func AesGCMEncryptWithNonce(plaintext, key, nonce, additionalData []byte) ([]byte, []byte, error)

AesGCMEncryptWithNonce AES-GCM 加密, (Galois/Counter Mode (GCM)) key 长度分别是 16 (AES-128), 32 (AES-256)

func Decrypt

func Decrypt(value, secret string) string

Decrypt 解密

func DesCBCDeB58

func DesCBCDeB58(s string, key []byte) []byte

DesCBCDeB58 解密, ZerosPadding

func DesCBCDeB64

func DesCBCDeB64(s string, key []byte) []byte

DesCBCDeB64 解密, ZerosPadding

func DesCBCDeHex

func DesCBCDeHex(s string, key []byte) []byte

DesCBCDeHex 解密, ZerosPadding

func DesCBCDePKCS7B58

func DesCBCDePKCS7B58(s string, key []byte) []byte

DesCBCDePKCS7B58 解密, Pkcs7Padding

func DesCBCDePKCS7B64

func DesCBCDePKCS7B64(s string, key []byte) []byte

DesCBCDePKCS7B64 解密, Pkcs7Padding

func DesCBCDePKCS7Hex

func DesCBCDePKCS7Hex(s string, key []byte) []byte

DesCBCDePKCS7Hex 解密, Pkcs7Padding

func DesCBCDePKCS7StringB58

func DesCBCDePKCS7StringB58(s string, key []byte) string

DesCBCDePKCS7StringB58 解密, Pkcs7Padding

func DesCBCDePKCS7StringB64

func DesCBCDePKCS7StringB64(s string, key []byte) string

DesCBCDePKCS7StringB64 解密, Pkcs7Padding

func DesCBCDePKCS7StringHex

func DesCBCDePKCS7StringHex(s string, key []byte) string

DesCBCDePKCS7StringHex 解密, Pkcs7Padding

func DesCBCDeStringB58

func DesCBCDeStringB58(s string, key []byte) string

DesCBCDeStringB58 解密, ZerosPadding

func DesCBCDeStringB64

func DesCBCDeStringB64(s string, key []byte) string

DesCBCDeStringB64 解密, ZerosPadding

func DesCBCDeStringHex

func DesCBCDeStringHex(s string, key []byte) string

DesCBCDeStringHex 解密, ZerosPadding

func DesCBCDecrypt

func DesCBCDecrypt(asPKCS7 bool, ciphertext, key []byte, ivs ...[]byte) (plaintext []byte)

DesCBCDecrypt AES-CBC 解密

func DesCBCDecryptE

func DesCBCDecryptE(asPKCS7 bool, ciphertext, key []byte, ivs ...[]byte) ([]byte, error)

DesCBCDecryptE DES-CBC 解密, 密码分组链接模式 (Cipher Block Chaining (CBC))

func DesCBCEnB58

func DesCBCEnB58(b, key []byte) string

DesCBCEnB58 加密, ZerosPadding

func DesCBCEnB64

func DesCBCEnB64(b, key []byte) string

DesCBCEnB64 加密, ZerosPadding

func DesCBCEnHex

func DesCBCEnHex(b, key []byte) string

DesCBCEnHex 加密, ZerosPadding

func DesCBCEnPKCS7B58

func DesCBCEnPKCS7B58(b, key []byte) string

DesCBCEnPKCS7B58 加密, Pkcs7Padding

func DesCBCEnPKCS7B64

func DesCBCEnPKCS7B64(b, key []byte) string

DesCBCEnPKCS7B64 加密, Pkcs7Padding

func DesCBCEnPKCS7Hex

func DesCBCEnPKCS7Hex(b, key []byte) string

DesCBCEnPKCS7Hex 加密, Pkcs7Padding

func DesCBCEnPKCS7StringB58

func DesCBCEnPKCS7StringB58(s string, key []byte) string

DesCBCEnPKCS7StringB58 加密, Pkcs7Padding

func DesCBCEnPKCS7StringB64

func DesCBCEnPKCS7StringB64(s string, key []byte) string

DesCBCEnPKCS7StringB64 加密, Pkcs7Padding

func DesCBCEnPKCS7StringHex

func DesCBCEnPKCS7StringHex(s string, key []byte) string

DesCBCEnPKCS7StringHex 加密, Pkcs7Padding

func DesCBCEnStringB58

func DesCBCEnStringB58(s string, key []byte) string

DesCBCEnStringB58 加密, ZerosPadding

func DesCBCEnStringB64

func DesCBCEnStringB64(s string, key []byte) string

DesCBCEnStringB64 加密, ZerosPadding

func DesCBCEnStringHex

func DesCBCEnStringHex(s string, key []byte) string

DesCBCEnStringHex 加密, ZerosPadding

func DesCBCEncrypt

func DesCBCEncrypt(asPKCS7 bool, plaintext, key []byte, ivs ...[]byte) (ciphertext []byte)

DesCBCEncrypt AES-CBC 加密

func DesCBCEncryptE

func DesCBCEncryptE(asPKCS7 bool, plaintext, key []byte, ivs ...[]byte) ([]byte, error)

DesCBCEncryptE DES-CBC 加密, 密码分组链接模式 (Cipher Block Chaining (CBC)) key 长度固定为 8 asPKCS7: false (ZerosPadding), true (Pkcs7Padding)

func Encrypt

func Encrypt(value, secret string) string

Encrypt 加密 (密钥取 32 位 MD5, AES-CBC, base58)

func GCMDeB58

func GCMDeB58(s string, key []byte) []byte

GCMDeB58 解密

func GCMDeB64

func GCMDeB64(s string, key []byte) []byte

GCMDeB64 解密

func GCMDeHex

func GCMDeHex(s string, key []byte) []byte

GCMDeHex 解密

func GCMDeStringB58

func GCMDeStringB58(s string, key []byte) string

GCMDeStringB58 解密

func GCMDeStringB64

func GCMDeStringB64(s string, key []byte) string

GCMDeStringB64 解密

func GCMDeStringHex

func GCMDeStringHex(s string, key []byte) string

GCMDeStringHex 解密

func GCMDecrypt

func GCMDecrypt(encrypted, key []byte) ([]byte, error)

GCMDecrypt AES-GCM 解密

func GCMEnB58

func GCMEnB58(b, key []byte) string

GCMEnB58 加密

func GCMEnB64

func GCMEnB64(b, key []byte) string

GCMEnB64 加密

func GCMEnHex

func GCMEnHex(b, key []byte) string

GCMEnHex 加密

func GCMEnStringB58

func GCMEnStringB58(s string, key []byte) string

GCMEnStringB58 加密

func GCMEnStringB64

func GCMEnStringB64(s string, key []byte) string

GCMEnStringB64 加密

func GCMEnStringHex

func GCMEnStringHex(s string, key []byte) string

GCMEnStringHex 加密

func GCMEncrypt

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

GCMEncrypt AES-GCM 加密

func GenRSAKey

func GenRSAKey(bits int) (publicKey, privateKey []byte)

GenRSAKey 生成 RSA 密钥对 openssl genrsa -out rsa_private_key.pem 1024 openssl rsa -in rsa_private_key.pem -pubout -out rsa_public_key.pem

func GetenvDecrypt

func GetenvDecrypt(key string, secret string) string

GetenvDecrypt 解密环境变量参数(string)

func Padding

func Padding(b []byte, bSize int, pkcs7 bool) []byte

Padding 填充

func ParsePrivateKey

func ParsePrivateKey(privateKey []byte) (priv *rsa.PrivateKey, err error)

ParsePrivateKey parses an RSA private key in PKCS #1, ASN.1 DER form.

func ParsePublicKey

func ParsePublicKey(publicKey []byte) (pub *rsa.PublicKey, err error)

ParsePublicKey parses a public key in PKIX, ASN.1 DER form.

func RSADecrypt

func RSADecrypt(ciphertext, privateKey []byte) ([]byte, error)

RSADecrypt 私钥解密

func RSAEncrypt

func RSAEncrypt(plaintext, publicKey []byte) ([]byte, error)

RSAEncrypt 公钥加密

func RSASign

func RSASign(data, privateKey []byte) ([]byte, error)

RSASign 私钥签名

func RSASignVerify

func RSASignVerify(data, publicKey, sig []byte) error

RSASignVerify 公钥验证签名

func SetenvEncrypt

func SetenvEncrypt(key, value, secret string) (string, error)

SetenvEncrypt 加密并设置环境变量(string)

func UnPadding

func UnPadding(b []byte, pkcs7 bool) []byte

UnPadding 去除填充

func XOR

func XOR(src, key []byte) []byte

XOR 异或加解密

func XORDeB58

func XORDeB58(s string, key []byte) []byte

XORDeB58 解密

func XORDeB64

func XORDeB64(s string, key []byte) []byte

XORDeB64 解密

func XORDeHex

func XORDeHex(s string, key []byte) []byte

XORDeHex 解密

func XORDeStringB58

func XORDeStringB58(s string, key []byte) string

XORDeStringB58 解密

func XORDeStringB64

func XORDeStringB64(s string, key []byte) string

XORDeStringB64 解密

func XORDeStringHex

func XORDeStringHex(s string, key []byte) string

XORDeStringHex 解密

func XORE

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

XORE RC4 加密算法(异或运算), 简单加解密, 不够安全 key 长度是 1-256

func XOREnB58

func XOREnB58(b, key []byte) string

XOREnB58 加密

func XOREnB64

func XOREnB64(b, key []byte) string

XOREnB64 加密

func XOREnHex

func XOREnHex(b, key []byte) string

XOREnHex 加密

func XOREnStringB58

func XOREnStringB58(s string, key []byte) string

XOREnStringB58 加密

func XOREnStringB64

func XOREnStringB64(s string, key []byte) string

XOREnStringB64 加密

func XOREnStringHex

func XOREnStringHex(s string, key []byte) string

XOREnStringHex 加密

Types

This section is empty.

Jump to

Keyboard shortcuts

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