shield

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2024 License: MIT Imports: 14 Imported by: 0

README

shield

simple and easy to use crypto things

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CBCDecrypt

func CBCDecrypt(key, data []byte) ([]byte, error)

CBCDecrypt

@Description: AES CBC Decryption
@param key
@param data
@return []byte
@return error

func CBCDecryptString

func CBCDecryptString(key, data string) (string, error)

CBCDecryptString

@Description: AES CBC Decryption
@param key
@param data
@return string
@return error

func CBCEncrypt

func CBCEncrypt(key, data []byte) ([]byte, error)

CBCEncrypt

@Description: AES CBC Encryption
@param key
@param data
@return []byte
@return error

func CBCEncryptString

func CBCEncryptString(key, data string) (string, error)

CBCEncryptString

@Description: AES CBC Encryption
@param key
@param data
@return string
@return error

func GetDecryptMsg

func GetDecryptMsg(privateKeyString, data string) ([]byte, error)

GetDecryptMsg

@Description: get decrypt message
@param privateKeyString
@param data
@return []byte
@return error

func GetRSAKey

func GetRSAKey(bits int) (string, string, error)

GetRSAKey

@Description: get rsa key
@param bits
@return string
@return string
@return error

func GetRSASignature

func GetRSASignature(privateKeyBytes, msg []byte, hashFunc crypto.Hash) (string, error)

GetRSASignature

@Description: get rsa signature
@param privateKeyBytes
@param msg
@param hashFunc
@return string
@return error

func MD5

func MD5(str string) string

MD5

@Description: MD5 Encryption
@param str
@return string

func MD5Large

func MD5Large(str string) (string, error)

MD5Large

@Description: MD5 Encryption for large string
@param str
@return string

func MD5Small

func MD5Small(str string) string

MD5Small

@Description: MD5 Encryption for small string
@param str
@return string

func MD5stream

func MD5stream(r io.Reader) (string, error)

MD5stream

@Description: MD5 Encryption for stream
@param r
@return string
@return error

func RSADecrypt

func RSADecrypt(privateKeyBytes, data []byte) ([]byte, error)

RSADecrypt

@Description: rsa decrypt
@param privateKeyBytes
@param data
@return []byte
@return error

Types

This section is empty.

Jump to

Keyboard shortcuts

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