lfile

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2018 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package lfile defines a collection of operation and definitions for lyra files

Index

Constants

This section is empty.

Variables

View Source
var Separator = "@!"

Separator defines delimitor for Salt and Nonce

Functions

This section is empty.

Types

type Authenticater

type Authenticater interface {
	//GenerateAuthParams generates a new authentication parameters, this involves
	//generating a new nonce for each enciphering of the plaintext. An
	//error is returned in the event of any issues.
	GenerateAuthParams() error
}

Authenticater defines Authentication operations

type Decipher

type Decipher interface {
	//DecipherFile deciphers a file and returns a pointer to a lyraFile.
	DecipherFile(key *lcrypt.LKey) (*LyraFile, error)

	Writer
}

Decipher defines decrypting operations

type Encipher

type Encipher interface {
	//EncipherFile enciphers a file and returns a pointer to a secureLyraFile.
	EncipherFile(key *lcrypt.LKey) (*SecureLyraFile, error)

	Writer
}

Encipher defines encrypting operations

type LyraFile

type LyraFile struct {
	// contains filtered or unexported fields
}

LyraFile represents a deciphered/unencrypted file (also known as a plaintext file).

func NewParsedLyraFile

func NewParsedLyraFile(file string) (*LyraFile, error)

NewParsedLyraFile returns a newly created lyrafile that was parsed from file

func (*LyraFile) DestroyFile

func (payload *LyraFile) DestroyFile() error

DestroyFile safely destroys payload lyrafile, return an error if unable to do so

func (*LyraFile) EncipherFile

func (payload *LyraFile) EncipherFile(key *lcrypt.LKey) (*SecureLyraFile, error)

EncipherFile a LyraFile to a SecureLyraFile and securely destroys the lyrafile upon successful encryption.

func (*LyraFile) ParseFile

func (payload *LyraFile) ParseFile(file string) error

ParseFile parses unencrypted file *os.File to a LyraFile struct

func (*LyraFile) PrintLyraFile

func (payload *LyraFile) PrintLyraFile()

PrintLyraFile prints the plaintext of the lyrafile to stdout

func (*LyraFile) Write

func (payload *LyraFile) Write(wd string) error

Write, writes a LyraFile to a path Wd and destroys the lyrafile upon successful write

type Parser

type Parser interface {
	//ParseFile, Parses a file
	ParseFile(file string) error
}

Parser defines parsing utils

type Printer

type Printer interface {
	//Print str to Reader
	Print(reader io.Reader, str string)
}

Printer defines printing operations

type Sanitizer

type Sanitizer interface {
	DestroyFile() error
}

Sanitizer defines secure destruction of sensitive information

type SecureLyraFile

type SecureLyraFile struct {
	// contains filtered or unexported fields
}

SecureLyraFile represents an enciphered file.

func NewParsedSLFile

func NewParsedSLFile(file string) (*SecureLyraFile, error)

NewParsedSLFile returns a newly created securelyrafile that was parsed from file

func (*SecureLyraFile) DecipherFile

func (payload *SecureLyraFile) DecipherFile(key *lcrypt.LKey) (*LyraFile, error)

DecipherFile deciphers a SecureLyraFile to a new LyraFile

func (*SecureLyraFile) GenerateAuthParams

func (payload *SecureLyraFile) GenerateAuthParams() error

GenerateAuthParams for a new nonce and salt parameters for an encryption of a LyraFile

func (*SecureLyraFile) ParseFile

func (payload *SecureLyraFile) ParseFile(file string) error

ParseFile parses encrypted file *os.File to a SecureLyraFile struct

func (*SecureLyraFile) RetrieveSalt

func (payload *SecureLyraFile) RetrieveSalt() []byte

RetrieveSalt returns this securelyrafile's salt value

func (*SecureLyraFile) SeedSalt

func (payload *SecureLyraFile) SeedSalt(salt []byte)

SeedSalt seeds a salt value to a secureLyraFile

func (*SecureLyraFile) Write

func (payload *SecureLyraFile) Write(wd string) error

Write, writes a SecureLyraFile to a path wd

type Writer

type Writer interface {
	//Writes a to a specific place
	Write(wd string) error
}

Writer defines write operations

Jump to

Keyboard shortcuts

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