cryptos

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const DesKeyLetter = helps.StrNumberAlpha // des密鑰字串
View Source
const DesKeySize = 8 // des密鑰長度

Variables

This section is empty.

Functions

func Base64Decode

func Base64Decode(input []byte) ([]byte, error)

Base64Decode base64解密

func Base64Encode

func Base64Encode(input []byte) []byte

Base64Encode base64加密

func DesCBCDecrypt

func DesCBCDecrypt(padding Padding, key, iv, src []byte) (out []byte, err error)

DesCBCDecrypt des-cbc解密, 注意key的長度必須是 DesKeySize

func DesCBCEncrypt

func DesCBCEncrypt(padding Padding, key, iv, src []byte) (out []byte, err error)

DesCBCEncrypt des-cbc加密, 注意key的長度必須是 DesKeySize

func DesECBDecrypt

func DesECBDecrypt(padding Padding, key, src []byte) (out []byte, err error)

DesECBDecrypt des-ecb解密, 注意key的長度必須是 DesKeySize

func DesECBEncrypt

func DesECBEncrypt(padding Padding, key, src []byte) (out []byte, err error)

DesECBEncrypt des-ecb加密, 注意key的長度必須是 DesKeySize

func MD5String

func MD5String(input []byte) string

MD5String 取得md5字串

func RandDesKey

func RandDesKey() []byte

RandDesKey 產生隨機des密鑰

func RandDesKeyString

func RandDesKeyString() string

RandDesKeyString 產生隨機des密鑰字串

Types

type Padding

type Padding = int

Padding 填充模式

const (
	PaddingZero  Padding = iota // zeropad填充
	PaddingPKCS7                // pkcs7填充
)

Jump to

Keyboard shortcuts

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