lsencrypt

package
v0.0.24 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Keys 默认密钥Key,也是用来补充Key长度用的。
	// 当用户调用加、解密时,一般会输入密钥,此时这个keys就会失效。所以在这里明文也不会造成密钥泄露
	Keys = "HzLv&ShGao@#HIC^(2).$China*202412"
)

Functions

func DesDecrypt

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

DesDecrypt DES解密

func DesEncrypt

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

DesEncrypt DES加密

func MD5Hash added in v0.0.9

func MD5Hash(origData string) (string, error)

MD5Hash calc md5 code for origData 返回 计算所得MD5码

func PKCS5Padding

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

PKCS5Padding pkcs5 padding 返回PKCS5Padding后的数据

func PKCS5UnPadding

func PKCS5UnPadding(origData []byte) []byte

PKCS5UnPadding pkcs5 unpadding 返回PKCS5UnPadding后的数据

func TripleDesDecrypt

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

TripleDesDecrypt 3DES解密

func TripleDesEncrypt

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

TripleDesEncrypt 3DES加密,返回加密后的数据,base64编码

func ZeroPadding

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

ZeroPadding zero padding 返回ZeroPadding后的字节数组

func ZeroUnPadding

func ZeroUnPadding(origData []byte) []byte

ZeroUnPadding zero unpadding 返回ZeroUnPadding后的数据

Types

This section is empty.

Jump to

Keyboard shortcuts

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