aes256

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2020 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CBCDecrypt

func CBCDecrypt(key, ciphertext []byte) (plaintext []byte)

CBCDecrypt decrypts the given ciphertext with AES-256 in CBC mode and returns the resulting plaintext. The supplied key must be 32 bytes long and the ciphertext must be prepended by the corresponding IV.

func CBCEncrypt

func CBCEncrypt(key, plaintext []byte, rand io.Reader) (ciphertext []byte)

CBCEncrypt encrypts the given plaintext with AES-256 in CBC mode. The supplied key must be 32 bytes long. The returned ciphertext is prepended by a randomly generated IV.

func CTRDecrypt

func CTRDecrypt(key, ciphertext []byte) (plaintext []byte)

CTRDecrypt decrypts the given ciphertext with AES-256 in CTR mode and returns the resulting plaintext. The supplied key must be 32 bytes long and the ciphertext must be prepended by the corresponding IV.

func CTREncrypt

func CTREncrypt(key, plaintext []byte, rand io.Reader) (ciphertext []byte)

CTREncrypt encrypts the given plaintext with AES-256 in CTR mode. The supplied key must be 32 bytes long. The returned ciphertext is prepended by a randomly generated IV.

func CTRStream

func CTRStream(key, iv []byte) cipher.Stream

CTRStream creates a new AES-256 stream in CTR mode. The supplied key must be 32 bytes long and the iv 16 bytes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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