aes

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2023 License: MIT Imports: 8 Imported by: 5

README

go fmt go vet go test

aes

AES encryption/decryption library

Based on the encryption article by Nic Raboy.

Usage

Encrypt
import (
  "github.com/erikbryant/aes"
)

plainText := "rattlesnake"
passphrase := "bites"

cipherText, err := aes.Encrypt(plainText, passphrase)
if err != nil {
  return err
}
Decrypt
import (
  "github.com/erikbryant/aes"
)

cipherText := "vJ5fbgmTTPDc+ebBYbjaCq7JjOQWSy10T3JyC3wfF4Xp0UoEaq40"
passphrase := "bites"

plainText, err := aes.Decrypt(cipherText, passphrase)
if err != nil {
  return err
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(cipherData string, passphrase string) (string, error)

Decrypt decrypts an AES block using a given passphrase.

func Encrypt

func Encrypt(plainData string, passphrase string) (string, error)

Encrypt performs AES encryption on data using a given passphrase.

Types

This section is empty.

Jump to

Keyboard shortcuts

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