crypto

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AesDecryptCBC added in v0.2.0

func AesDecryptCBC(block cipher.Block, cipherText, iv []byte) ([]byte, error)

AesDecryptCBC 解密.

func AesDecryptECB added in v0.2.0

func AesDecryptECB(block cipher.Block, cipherBytes []byte) ([]byte, error)

AesDecryptECB 解密.

func AesEncryptCBC added in v0.2.0

func AesEncryptCBC(block cipher.Block, plaintext, iv []byte) []byte

AesEncryptCBC 加密.

func AesEncryptECB added in v0.2.0

func AesEncryptECB(block cipher.Block, plaintext []byte) []byte

AesEncryptECB 加密.

func Anonymous added in v0.1.4

func Anonymous(deviceId string) (string, error)

Anonymous 匿名用户生成.

func CacheKeyDecrypt added in v0.1.0

func CacheKeyDecrypt(data string) (string, error)

CacheKeyDecrypt 解密缓存 key.

func CacheKeyEncrypt added in v0.1.0

func CacheKeyEncrypt(data string) (string, error)

CacheKeyEncrypt 生成缓存 key.

func DLLEncodeID added in v0.1.4

func DLLEncodeID(someID string) (string, error)

DLLEncodeID region cloudmusic.dll (Windows) security. XORs bytes then returns its base64 MD5 hash. Used in encodeAnonymousId Searching for ID_XOR_KEY_1 in cloudmusic.dll will get you to their implementation.

func EApiDecrypt

func EApiDecrypt(ciphertext, encode string) ([]byte, error)

EApiDecrypt 解密,当解析请求参数是encode使用hex,当解析请求响应参数为空相当于二进制.

func EApiEncrypt

func EApiEncrypt(url string, object interface{}) (map[string]string, error)

EApiEncrypt 加密 通常在MAC、windows、android、ios中使用 todo: 貌似当url为空时存在问题,网易接口加密返回中有不带url的情况, 例如: DCC52B3013E9B66C038F8E027E580ECEDF84E0F44CB93FC365BED7B646A9BC08 .

func HexDigest added in v0.2.0

func HexDigest(text string) string

HexDigest .

func LinuxApiDecrypt

func LinuxApiDecrypt(cipherText string) ([]byte, error)

LinuxApiDecrypt 解密.

func LinuxApiEncrypt

func LinuxApiEncrypt(object interface{}) (map[string]string, error)

LinuxApiEncrypt 加密.

func Pkcs7Padding added in v0.2.0

func Pkcs7Padding(data []byte, blockSize int) ([]byte, error)

Pkcs7Padding 补码,严格遵循 RFC 5652 规范.

func Pkcs7UnPadding added in v0.2.0

func Pkcs7UnPadding(data []byte) ([]byte, error)

Pkcs7UnPadding 去码.

func RsaEncrypt added in v0.2.0

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

RsaEncrypt 公钥加密无填充方式.

func WeApiDecrypt

func WeApiDecrypt(params, encSecKey string) (map[string]string, error)

WeApiDecrypt 解密 TODO: 由于拿不到私钥则不能解密.

func WeApiEncrypt

func WeApiEncrypt(object interface{}) (map[string]string, error)

WeApiEncrypt 加密.

Types

This section is empty.

Jump to

Keyboard shortcuts

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