everglade

package module
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: May 27, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

README

Everglade Go Report Card GoDoc

An encryption framework

Overview

Everglade steamlines encryption suite implementation with Golang into a safe and simplistic process. Currently Everglade supports Salted AES-GCM-256, AES-CBC-256, SHA256, and RSA Encryption/Signing.

File Encryption

Everglade can also process files.

Directory Enumeration

Everglade has the capability to:

  1. Recursively map directories
  2. Search a directory recursively for a file
  3. Search a directory recursively for all files of a given type
Examples

For examples see test units.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bytes

func Bytes(n int) (error, []byte)

func FindFileInDirectory

func FindFileInDirectory(dir, fn string) (error, string)

FindFileInDirectory takes a directory and a filename and returns the relitive path of that file if exists

func PKCS5Pad

func PKCS5Pad(data []byte, bs int) []byte

func PKCS5Trim

func PKCS5Trim(data []byte) []byte

Types

type File

type File struct {
	Name string
}

func NewFile

func NewFile(fn string) File

NewFile creates a new file struct

func (*File) DecryptCBC

func (f *File) DecryptCBC(obj Object) error

DecryptCBC decrypts a file with AES-CBC-256 using the given Object

func (*File) DecryptGCM

func (f *File) DecryptGCM(obj Object, ad []byte) error

func (*File) DecryptOAEP

func (f *File) DecryptOAEP(obj Object, l []byte) error

func (*File) EncryptCBC

func (f *File) EncryptCBC(obj Object) error

EncryptCBC encrypts a file with AES-CBC-256 using the given Object

func (*File) EncryptGCM

func (f *File) EncryptGCM(obj Object, ad []byte) error

func (*File) EncryptOAEP

func (f *File) EncryptOAEP(obj Object, l []byte) error

type FileList

type FileList struct {
	Files []File
}

FileList allows iterability and discovery. Also manages key

func DiscoverFilesInDirectory

func DiscoverFilesInDirectory(dir, ex string) (error, FileList)

DiscoverFilesInDirectory automates discovery of files in directory and returns FileList

func FindFilesByTypeInDirectory

func FindFilesByTypeInDirectory(dir, ex string) (error, FileList)

FindFilesByTypeInDirectory returns the relative path of all files in the directory of a specific extension

type Object

type Object struct {
	BlockKey []byte
	RSAKey   *rsa.PrivateKey
}

func Import

func Import(j []byte) Object

func New

func New() Object

func (Object) DecryptCBC

func (o Object) DecryptCBC(iv, ct []byte) []byte

func (Object) DecryptGCM

func (o Object) DecryptGCM(n, ct, ad []byte) []byte

DecryptGCM using AES-GCM-256 with RSA Signature of component of RSA private key as associated data

func (Object) DecryptOAEP

func (o Object) DecryptOAEP(ct, l []byte) (error, []byte)

func (Object) EncryptCBC

func (o Object) EncryptCBC(pt []byte) ([]byte, []byte)

func (Object) EncryptGCM

func (o Object) EncryptGCM(pt, ad []byte) ([]byte, []byte)

EncryptGCM using AES-GCM-256 with RSA Signature of component of RSA private key as associated data

func (Object) EncryptOAEP

func (o Object) EncryptOAEP(pt, l []byte) (error, []byte)

func (Object) Export

func (o Object) Export() []byte

func (Object) Hash

func (o Object) Hash(salt, pt []byte) []byte

func (Object) Sign

func (o Object) Sign(pt []byte) (error, []byte)

Sign data with RSASSA-PKCS1-V1_5-SIGN from RSA PKCS#1 v1.5 using o.RSAKey

func (Object) Verify

func (o Object) Verify(pt, s []byte) (error, bool)

Verify a signature with RSASSA-PKCS1-V1_5-SIGN from RSA PKCS#1 v1.5 using o.RSAKey

Jump to

Keyboard shortcuts

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