cbcutil

package
v0.0.0-20241021161600-... Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Overview

CBC describes a block cipher mode. In cryptography, a block cipher mode of operation is an algorithm that uses a block cipher to provide an information service such as confidentiality or authenticity. A block cipher by itself is only suitable for the secure cryptographic transformation (encryption or decryption) of one fixed-length group of bits called a block. A mode of operation describes how to repeatedly apply a cipher's single-block operation to securely transform amounts of data larger than a block.

This package simplifies the usage of AES-256-CBC.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

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

Decrypt is a function that decrypts a given cipher text with a provided key and initialization vector(iv).

func DecryptFile

func DecryptFile(key, iv []byte, file File) error

func Encrypt

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

Encrypt is a function that encrypts plaintext with a given key and an optional initialization vector(iv).

func EncryptStream

func EncryptStream(key, iv, macKey []byte, plaintext io.Reader, ciphertext io.Writer) ([]byte, []byte, uint64, uint64, error)

Types

type File

type File interface {
	io.Reader
	io.WriterAt
	Truncate(size int64) error
	Stat() (os.FileInfo, error)
}

Jump to

Keyboard shortcuts

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