crypto

package
v1.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AesDecrypt

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

AesDecrypt AES解密

func AesEncrypt

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

AesEncrypt AES加密

func DesDecrypt

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

DesDecrypt DES解密

func DesEncrypt

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

DesEncrypt DES加密

func GenerateRSAKeyPair

func GenerateRSAKeyPair() (*rsa.PrivateKey, *rsa.PublicKey, error)

func PKCS5Padding

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

使用PKCS5进行填充

func PKCS5UnPadding

func PKCS5UnPadding(cipherText []byte, blockSize int) ([]byte, error)

去除PKCS5填充

func PrivateKeyToString

func PrivateKeyToString(priv *rsa.PrivateKey) string

func PublicKeyToString

func PublicKeyToString(pub *rsa.PublicKey) (string, error)

func RSADecrypt

func RSADecrypt(ciphertext []byte, privkey *rsa.PrivateKey) ([]byte, error)

func RSAEncrypt

func RSAEncrypt(plaintext []byte, pubkey *rsa.PublicKey) ([]byte, error)

func StringToPrivateKey

func StringToPrivateKey(privStr string) (*rsa.PrivateKey, error)

func StringToPublicKey

func StringToPublicKey(pubStr string) (*rsa.PublicKey, error)

func TripleDesDecrypt

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

TripleDesDecrypt 3DES解密

func TripleDesEncrypt

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

TripleDesEncrypt 3DES加密

Types

This section is empty.

Jump to

Keyboard shortcuts

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