encryption

package module
v0.0.0-...-1a4fc35 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2025 License: MIT Imports: 6 Imported by: 0

README

Go Reference Report card

encryption

encryption provides simple and secure encryption utilities using ChaCha20-Poly1305, with base64 encoding/decoding support.

Installation

go get github.com/LightArrayCapital/go-utilities/encryption

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(cipherText []byte, key []byte) ([]byte, error)

func DecryptString

func DecryptString(cipherText string, key []byte, cipherTextEncoding Encoding) (string, error)

func Encrypt

func Encrypt(plainText []byte, key []byte) ([]byte, error)

func EncryptString

func EncryptString(plainText string, key []byte, cipherTextEncoding Encoding) (string, error)

Types

type Encoding

type Encoding string
const (
	EncodingBase64 Encoding = "base64"
	EncodingHex    Encoding = "hex"
)

Jump to

Keyboard shortcuts

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