encryption

package
v0.2.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: May 24, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AES

type AES struct {
	// Key Length must be (12|24|32).
	Key []byte
}

AES encryption.

func New

func New(passphrase string) (n *AES)

New AES encryptor for passphrase.

func (*AES) Decrypt

func (r *AES) Decrypt(encrypted string) (plain string, err error)

Decrypt and AES encrypted string. The `encrypted` string is an AES encrypted; base64 encoded string. Returns the decoded string.

func (*AES) Encrypt

func (r *AES) Encrypt(plain string) (encrypted string, err error)

Encrypt plain string. Returns an AES encrypted; base64 encoded string.

func (*AES) With

func (r *AES) With(passphrase string)

With Sets the key using the passphrase. Only the first 32 bytes of the passphrase are used.

Jump to

Keyboard shortcuts

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