crypt

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2018 License: Unlicense Imports: 3 Imported by: 3

Documentation

Overview

Package crypt is the combination of a BlockCrypt and buf.Byte that stares encrypted and returns decrypted data if a BlockCrypt is loaded.

This is used by the wallet to keep private keys from being copied inside the memory of the application when they are not being worked on.

If there is no BlockCrypt the same code can be used but the data is not protected. This is for the case of a user who does not encrypt their wallet, or has other measures such as VM isolation to protect the wallet process's memory.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Crypt

type Crypt struct {
	*buf.Byte
	BC *blockcrypt.BlockCrypt
}

Crypt is a generic structure for storing bytes encrypted and reading them to a another buffer, using a BlockCrypt AES-GCM 256 cipher

func New

func New() *Crypt

New returns a new, empty Crypt

func (*Crypt) CopyBC

func (r *Crypt) CopyBC() (R *Crypt)

CopyBC creates a new crypt out of the current one like a factory

func (*Crypt) Get

func (r *Crypt) Get() (out proto.Buffer)

Get returns a secure buffer containing the decrypted data in the Crypt

func (*Crypt) Put

func (r *Crypt) Put(in proto.Buffer) *Crypt

Put writes a secure buffer to the Crypt

func (*Crypt) WithBC

func (r *Crypt) WithBC(bc *blockcrypt.BlockCrypt) *Crypt

WithBC loads a crypter into the Crypt

Jump to

Keyboard shortcuts

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