crypt

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDataToLarge     = errors.New("message too long for RSA public key size")
	ErrDataLen         = errors.New("data length error")
	ErrDataBroken      = errors.New("data broken, first byte is not zero")
	ErrKeyPairDismatch = errors.New("data is not encrypted by the private key")
	ErrDecryption      = errors.New("decryption error")
	ErrPublicKey       = errors.New("get public key error")
	ErrPrivateKey      = errors.New("get private key error")
)

Functions

func Decrypt

func Decrypt(strTobeDeCrypted string, args ...string) (string, error)

Decrypt 加密字符串

func Encrypt

func Encrypt(strTobeEnCrypted string, args ...string) (string, error)

Encrypt 加密字符串

func EncryptPwd

func EncryptPwd(password string, ivs ...string) (string, error)

EncryptPwd 加密密码

func RsaSignWithPrivateKey

func RsaSignWithPrivateKey(origData, private_key_bts []byte) (bts []byte, err error)

Types

type Cipher

type Cipher struct {
	// contains filtered or unexported fields
}

func New

func New(mode string, attrs map[string]interface{}) (c *Cipher, err error)

func (*Cipher) Decrypt

func (c *Cipher) Decrypt(src []byte) (out []byte, err error)

func (*Cipher) DecryptFromString

func (c *Cipher) DecryptFromString(src string) (out []byte, err error)

func (*Cipher) Encrypt

func (c *Cipher) Encrypt(bts []byte) (out []byte, err error)

func (*Cipher) EncryptToString

func (c *Cipher) EncryptToString(bts []byte) (out string, err error)

type DesCrypter

type DesCrypter struct {
	// contains filtered or unexported fields
}

type TripleDesCrypter

type TripleDesCrypter struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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