crypt

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: BSD-2-Clause Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block interface {
	Decrypt([]byte) ([]byte, error)           // Decrypt decrypts the provided data
	DecryptFromString(string) ([]byte, error) // DecryptFromString decrypts data stored in a hex encoded string
	Encrypt([]byte) ([]byte, error)           // Encrypt encrypts the provided data
	EncryptToString([]byte) (string, error)   // EncryptToString encrypts the provided data and returns it as a nex encoded string
}

Block is an interface that wraps an AES Cipher to be used for encryption and decryption of data.

func NewBlock

func NewBlock(key []byte) (Block, error)

NewBlock returns an AES GCM Block to be used with Encrypt and Decrypt functions.

Jump to

Keyboard shortcuts

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