encryption

package
v0.0.0-...-da75f93 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2017 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package encryption performs encryption using AES256 CBC + HMAC SHA256.

Index

Constants

View Source
const (
	// KeyLength is the expected key length, in bytes.
	KeyLength = 256 / 8
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

type Key []byte

Key is a 256 bit encryption key.

func (Key) Decrypt

func (key Key) Decrypt(ciphertext string) (cleartext []byte, err error)

Decrypt the ciphertext.

func (Key) DecryptString

func (key Key) DecryptString(ciphertext string) (cleartext string, err error)

DecryptString decrypts the ciphertext into a string value.

func (Key) Encrypt

func (key Key) Encrypt(cleartext []byte) (ciphertext string, err error)

Encrypt cleartext bytes into a base64 ciphertext string

func (Key) EncryptString

func (key Key) EncryptString(cleartext string) (ciphertext string, err error)

EncryptString encrypts a string value.

Jump to

Keyboard shortcuts

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