Documentation
¶
Overview ¶
* @Description: gomall * @Author: ylf * @Date: 2025-03-04 17:26:33 * @LastEditTime: 2025-03-04 17:31:08 * @LastEditors: ylf * @FilePath: \ltool\encrypt\rsa.go
Index ¶
- Constants
- func DeCryptBlocks(dst, src []byte, block cipher.Block)
- func EnCryptBlocks(encryptData, src []byte, block cipher.Block)
- func FRsa解密(tk, 私钥 string) (str string, err error)
- func FmtMd5(inter ...interface{}) string
- func F处理密钥(keystr string) (genKey []byte)
- func F处理密钥格式(key ...string) []byte
- func F拼接参数(inter ...interface{}) (key string)
- func F按双划线切割字符串(theme, 切分符 string) (arr []string)
- func F是否包含中文(str string) bool
- func F生成公私钥(name string, 长度 ...int)
- func F私钥加上前后缀(privateKey string) string
- func F获取加盐密码(s string) string
- func F解析rsa私钥(privateKey string) (*rsa.PrivateKey, error)
- func F读取公钥证书文件(pt string) (str string, err error)
- func GenRsaKey(bits int, name string) error
- func Md5(s string) string
- func Md5Byte(by []byte) string
- func PKCS7Padding(ciphertext []byte, blockSize int) []byte
- func PKCS7UnPadding(src []byte) []byte
- func Rsa2签名(signContent string, privateKey string, hash crypto.Hash) string
- func SaltMd5(s string) string
- func SplitByLength(str string, length int) []string
- type F设置方法
- type I设置接口
- type N新ase
- func (a *N新ase) AesDecryptCBC(encrypted []byte) (decrypted []byte, err error)
- func (a *N新ase) AesDecryptCFB(encrypted []byte) (decrypted []byte, err error)
- func (a *N新ase) AesDecryptECB(encrypted []byte) (decrypted []byte, err error)
- func (a *N新ase) AesEncryptCBC(origData []byte) (encrypted []byte, err error)
- func (a *N新ase) AesEncryptCFB(origData []byte) (encrypted []byte, err error)
- func (a *N新ase) AesEncryptECB(origData []byte) (encrypted []byte, err error)
- func (a *N新ase) F加密信息(body string) (string, error)
- func (a *N新ase) F获取偏移量() (iv []byte)
- func (a *N新ase) F获取加密补全方法() func(ciphertext []byte, blockSize int) []byte
- func (a *N新ase) F获取解密补全方法() func(origData []byte) []byte
- func (a *N新ase) F解密信息(body string) (string, error)
- type S3Desc加解密
- type SASE加解密
- type S加解密接口
Constants ¶
View Source
const ( V请求方法_CBC = "CBC" V请求方法_CFB = "CFB" V请求方法_ECB = "ECB" V加解密方式_base64 = "base64" V加解密方式_hex = "hex" V填充方式_pkcs5Padding = "pkcs5Padding" V填充方式_pkcs7Padding = "pkcs7Padding" )
View Source
const ( PEM_BEGIN = "-----BEGIN RSA PRIVATE KEY-----\n" PEM_END = "\n-----END RSA PRIVATE KEY-----" )
Variables ¶
This section is empty.
Functions ¶
func DeCryptBlocks ¶
func EnCryptBlocks ¶
func PKCS7Padding ¶
func PKCS7UnPadding ¶
func SplitByLength ¶
Types ¶
type F设置方法 ¶
type F设置方法 struct {
// contains filtered or unexported fields
}
func F新建ase设置方法 ¶
func F设置加密加解密方式 ¶
type N新ase ¶
type N新ase struct {
ASE密钥 []byte
V偏移量 []byte
V加密块 cipher.Block
V请求方法, V填充方式 string //支持CBC CFB ECB
V加密结果方法 string //支持base64 hex
}
func (*N新ase) AesDecryptCBC ¶
func (*N新ase) AesDecryptCFB ¶
func (*N新ase) AesDecryptECB ¶
func (*N新ase) AesEncryptCBC ¶
=================== CBC ======================
func (*N新ase) AesEncryptCFB ¶
=================== CFB ======================
func (*N新ase) AesEncryptECB ¶
=================== ECB ======================
Click to show internal directories.
Click to hide internal directories.