encrypt

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AESDecrypt

func AESDecrypt(cryted string, key string) string

Aes 解密 key: 24个字符

func AESEncrypt

func AESEncrypt(orig string, key string) string

Aes 加密 key: 24个字符

func Base64Decrypt

func Base64Decrypt(str string) (string, error)

Base64 解密

func Base64Encrypt

func Base64Encrypt(str string) string

Base64 加密

func DESDecrypt

func DESDecrypt(data string, key []byte) string

DES 解密 key:8位

func DESEncrypt

func DESEncrypt(origData, key []byte) string

DES 加密 key:8位

func Md5Fun01

func Md5Fun01(str string) string

func Md5Fun02

func Md5Fun02(str string) string

func Md5Fun03

func Md5Fun03(str string) string

func PKCS5Padding

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

实现明文的补码

func PKCS5UnPadding

func PKCS5UnPadding(origData []byte) []byte

去除补码

func PKCS7Padding

func PKCS7Padding(ciphertext []byte, blocksize int) []byte

补码 AES加密数据块分组长度必须为128bit(byte[16]),密钥长度可以是128bit(byte[16])、192bit(byte[24])、256bit(byte[32])中的任意一个。

func PKCS7UnPadding

func PKCS7UnPadding(origData []byte) []byte

去码

func RSADecrypt

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

解密

func RSAEncrypt

func RSAEncrypt(origData []byte) ([]byte, error)

加密

func Sha1

func Sha1(str string) string

Sha1 加密

func Sha256

func Sha256(str string) string

Sha256 加密

func Sha512

func Sha512(str string) string

Sha512 加密

func TripleDESDecrypt

func TripleDESDecrypt(crypted, key []byte) ([]byte, error)

3DES解密 key:24位

func TripleDESEncrypt

func TripleDESEncrypt(origData, key []byte) ([]byte, error)

3DES加密 key:24位

Types

This section is empty.

Jump to

Keyboard shortcuts

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