encrypt

package
v0.5.12 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptDES

func DecryptDES(key, src []byte) []byte

func EncryptDES

func EncryptDES(key, src []byte) []byte

func Hashid

func Hashid(id, minLength int, salt string) string

func HashidInt64

func HashidInt64(id int64, minLength int, salt string) string

func Md5Byte

func Md5Byte(in []byte) string

func Md5String

func Md5String(in string) string

func NewECBDecrypter

func NewECBDecrypter(b cipher.Block) cipher.BlockMode

NewECBDecrypter returns a BlockMode which decrypts in electronic code book mode, using the given Block.

func NewECBEncrypter

func NewECBEncrypter(b cipher.Block) cipher.BlockMode

NewECBEncrypter returns a BlockMode which encrypts in electronic code book mode, using the given Block.

func Unhashid

func Unhashid(hashedid string, minLength int, salt string) int

func UnhashidInt64

func UnhashidInt64(hashedid string, minLength int, salt string) int64

Types

type AES

type AES struct{}

func (*AES) Decrypt

func (a *AES) Decrypt(crypted, key []byte) ([]byte, error)

func (*AES) Encrypt

func (a *AES) Encrypt(src, key string) ([]byte, error)

func (*AES) PKCS5Padding

func (a *AES) PKCS5Padding(ciphertext []byte, blockSize int) []byte

func (*AES) PKCS5UnPadding

func (a *AES) PKCS5UnPadding(origData []byte) []byte

type ECB

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

Jump to

Keyboard shortcuts

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