cryptography

package
v0.0.0-...-53ca941 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SECRET_KEY = []byte("ylzsxkwm")

	DesModeEncrypt = 0
	DesModeDecrypt = 1
)

Thanks to https://github.com/Levi233/MusicPlayer/blob/master/app/src/main/java/com/chenhao/musicplayer/utils/crypt/KuwoDES.java

Functions

func AESCBCDecrypt

func AESCBCDecrypt(cipherText, key, iv []byte) []byte

func AESCBCEncrypt

func AESCBCEncrypt(plainText, key, iv []byte) []byte

func AESECBDecrypt

func AESECBDecrypt(cipherText, key []byte) []byte

func AESECBEncrypt

func AESECBEncrypt(plainText, key []byte) []byte

func AesEncryptCBCWithIv

func AesEncryptCBCWithIv(origData []byte, key []byte, iv []byte) (encrypted []byte)

func BytesToPublicKey

func BytesToPublicKey(pub []byte) (*rsa.PublicKey, error)

BytesToPublicKey bytes to public key

func DESEncrypt

func DESEncrypt(src []byte) []byte

func EncryptWithPublicKey

func EncryptWithPublicKey(msg []byte, pub *rsa.PublicKey) ([]byte, error)

EncryptWithPublicKey encrypts data with public key

func NewECBDecrypter

func NewECBDecrypter(b cipher.Block) cipher.BlockMode

func NewECBEncrypter

func NewECBEncrypter(b cipher.Block) cipher.BlockMode

func ParsePublicKey

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

func RSAEncrypt

func RSAEncrypt(origData []byte, modulus string, exponent int64) string

func RSAEncryptV2

func RSAEncryptV2(origData []byte, publicKey *rsa.PublicKey) []byte

Types

This section is empty.

Jump to

Keyboard shortcuts

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