crypto

package
v0.0.0-...-75a46ef Latest Latest
Warning

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

Go to latest
Published: May 11, 2021 License: BSD-3-Clause, MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidBlockSize indicates hash blocksize <= 0.
	ErrInvalidBlockSize = errors.New("invalid blocksize")

	// ErrInvalidPKCS7Data indicates bad input to PKCS7 pad or unpad.
	ErrInvalidPKCS7Data = errors.New("invalid PKCS7 data (empty or not padded)")

	// ErrInvalidPKCS7Padding indicates PKCS7 unpad fails to bad input.
	ErrInvalidPKCS7Padding = errors.New("invalid padding on input")
)

PKCS7 errors.

Functions

func AesDecrypt

func AesDecrypt(key []byte, encryptedBytes []byte) []byte

AesDecrypt - Decrypt AES encrypted data with the key

func AesEncrypt

func AesEncrypt(key []byte, plainBytes []byte) []byte

func GenerateRSAKeyPair

func GenerateRSAKeyPair() ([]byte, *rsa.PrivateKey)

func RsaDecryptCipherBytes

func RsaDecryptCipherBytes(encryptedData []byte, privateKey *rsa.PrivateKey) []byte

func RsaEncryptBytes

func RsaEncryptBytes(plainBytes []byte, publicKey []byte) []byte

Types

This section is empty.

Jump to

Keyboard shortcuts

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