cipher

package
v0.0.0-...-93e9696 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package cipher is a package for common encrypt/decrypt of symmetric key messages.

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 Decrypt

func Decrypt(iv, key, ciphertext []byte) ([]byte, error)

Decrypt will use the given key, iv, and ciphertext and return the plaintext bytes.

func Encrypt

func Encrypt(iv, key, plaintext []byte) ([]byte, error)

Encrypt will use the given iv, key, and plaintext bytes and return ciphertext bytes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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