Documentation
¶
Overview ¶
Package lfile defines a collection of operation and definitions for lyra files
Index ¶
- Variables
- type Authenticater
- type Decipher
- type Encipher
- type LyraFile
- type Parser
- type Printer
- type Sanitizer
- type SecureLyraFile
- func (payload *SecureLyraFile) DecipherFile(key *lcrypt.LKey) (*LyraFile, error)
- func (payload *SecureLyraFile) GenerateAuthParams() error
- func (payload *SecureLyraFile) ParseFile(file string) error
- func (payload *SecureLyraFile) RetrieveSalt() []byte
- func (payload *SecureLyraFile) SeedSalt(salt []byte)
- func (payload *SecureLyraFile) Write(wd string) error
- type Writer
Constants ¶
This section is empty.
Variables ¶
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 ¶
NewParsedLyraFile returns a newly created lyrafile that was parsed from file
func (*LyraFile) DestroyFile ¶
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) PrintLyraFile ¶
func (payload *LyraFile) PrintLyraFile()
PrintLyraFile prints the plaintext of the lyrafile to stdout
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