encryption

package
v0.0.0-...-b4c32ca Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Credit

Index

Constants

View Source
const EncryptionKeySize = 32 // 32 bytes for AES-256

Variables

This section is empty.

Functions

func DecodeFromHex

func DecodeFromHex(data []byte) ([]byte, error)

func DecodeString

func DecodeString(data string) ([]byte, error)

func Decrypt

func Decrypt(ciphertext []byte, key []byte) (plaintext []byte, err error)

func EncodeToHex

func EncodeToHex(data []byte) []byte

func Encrypt

func Encrypt(plaintext []byte, key []byte) (ciphertext []byte, err error)

func NewEncodedKey

func NewEncodedKey() ([]byte, error)

func NewEncryptionKey

func NewEncryptionKey() ([]byte, error)

NewEncryptionKey generates a random 256-bit key for Encrypt() and Decrypt().

Types

This section is empty.

Jump to

Keyboard shortcuts

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