cryptoes

package
v0.0.0-...-7a3883e Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2022 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AESEncryptoModeECB = AESEncryptoMode(1)
	AESEncryptoModeCBC = AESEncryptoMode(2)
)

Constants

Variables

This section is empty.

Functions

func AESDecryptCBC

func AESDecryptCBC(crypted, key string, iv string) ([]byte, error)

AESDecryptCBC decrypt

func AESDecryptECB

func AESDecryptECB(crypted, key string) ([]byte, error)

AESDecryptECB aes decrypt

func AESEncryptCBC

func AESEncryptCBC(origData []byte, key string, iv string) (string, error)

AESEncryptCBC encrypt

func AESEncryptECB

func AESEncryptECB(origData []byte, key string) (string, error)

AESEncryptECB encrypt

func AesDecrypt

func AesDecrypt(crypted, key []byte, iv string, mode AESEncryptoMode) ([]byte, error)

AesDecrypt do aes decrypt

func AesEncrypt

func AesEncrypt(origData, key []byte, iv string, mode AESEncryptoMode) ([]byte, error)

AesEncrypt do aes encrypt

func Base64Decode

func Base64Decode(val string) ([]byte, error)

Base64Decode decode

func Base64Encode

func Base64Encode(val []byte) string

Base64Encode encode

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 PKCS7Padding

func PKCS7Padding(ciphertext []byte, blockSize int) []byte

PKCS7Padding do pkcs7 padding for aes encrypt

func PKCS7UnPadding

func PKCS7UnPadding(origData []byte) []byte

PKCS7UnPadding do pkcs7 unpadding

func RSAEncryptNE

func RSAEncryptNE(origData []byte, n *big.Int, e int) (string, error)

RSAEncryptNE rsa encrypt

Types

type AESCryptoModeError

type AESCryptoModeError int

AESCryptoModeError error

func (AESCryptoModeError) Error

func (k AESCryptoModeError) Error() string

type AESEncryptoMode

type AESEncryptoMode int

AESEncryptoMode aes encrypto mode

Jump to

Keyboard shortcuts

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