crypto

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AlgRsa = "rsa"
	AlgAes = "aes"
)

Variables

This section is empty.

Functions

func AesDecrypt

func AesDecrypt(crypted, key []byte) ([]byte, error)

func AesEncrypt

func AesEncrypt(origData, key []byte) ([]byte, error)

func GenAesKey

func GenAesKey() ([]byte, error)

func GenRsaKey

func GenRsaKey(bits int) (privateKey, publicKey string, err error)

func PKCS5Padding

func PKCS5Padding(plaintext []byte, blockSize int) []byte

func PKCS5UnPadding

func PKCS5UnPadding(origData []byte) []byte

func RsaDecryptHex

func RsaDecryptHex(encryptedData, privateKey string) (string, error)

func RsaEncryptHex

func RsaEncryptHex(originalData, publicKey string) (string, error)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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