encryption

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2022 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package encryption provides methods to encrypt and decrypt strings using a securely generated secret key

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

type Key []byte

Key represents a secret key used to encrypt/decrypt strings

func NewKey

func NewKey(bytes int) *Key

NewKey generates a new secret key with the given amount of bytes

func (Key) Base64

func (k Key) Base64() string

func (Key) Decrypt

func (k Key) Decrypt(cryptoText string) string

Decrypt decrypts a piece of text using the secret key

func (Key) Encrypt

func (k Key) Encrypt(text string) string

Encrypt encrypts a piece of text using the secret key

func (*Key) MarshalYAML

func (k *Key) MarshalYAML() (interface{}, error)

func (*Key) UnmarshalYAML

func (k *Key) UnmarshalYAML(unmarshal func(interface{}) error) error

Jump to

Keyboard shortcuts

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