util

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidCipherText is returned when the ciphertext is invalid.
	ErrInvalidCipherText = errors.New("invalid ciphertext")

	// ErrInvalidPadding is returned when the padding is invalid.
	// This is usually caused by an incorrect password.
	ErrInvalidPadding = errors.New("invalid padding")
)

Functions

func Decrypt

func Decrypt(encodedData, password string) (string, error)

Decrypt decrypts the given ciphertext with the given password.

func Encrypt

func Encrypt(data, password string) (string, string, error)

Encrypt encrypts the given data with the given password. A random password is generated if none is given.

Types

This section is empty.

Jump to

Keyboard shortcuts

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