NFEncryption

package
v0.0.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

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

Decrypt takes a ciphertext byte array and decrypts it using the provided key

func Encrypt

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

Encrypt takes a plaintext byte array and encrypts it using the provided key. It returns the ciphertext and an error if one occurs. It generates the cipher text using AES-GCM and a nonce. A Nonce is a number that can only be used once and will be unique for each encryption, but it is not a secret It is safe to store the nonce alongside the ciphertext The nonce is prepended to the ciphertext

Types

This section is empty.

Jump to

Keyboard shortcuts

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