storage

package
v1.5.23 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package storage is designed to securely store the most sensitive information (keys, passwords).

STORAGE ALGORITHM 'CREATE'

1. 	S = G(N)
	where
		G - generator pseudo random bytes,
		N - count of bytes for generator,
		S - pseudo random bytes (salt).
2. 	K = KDF(P, S)
	where
		KDF - key derivation function
		K - encryption key,
		P - password,
3.	EM = E(K, VM)
	where
		E - encryption function,
		EM - encrypted map/storage,
		VM - void map/storage.

STORAGE ALGORITHM 'SET'

1. 	M = D(K, EM)
	where
		D - decryption function
		M - map/storage
2. 	Km = KDF(Ki, S)
	where
		Km - key map/storage
		Ki - input key
3. 	Vm = E(Km, Vi)
	where
		Vm - value map/storage
		Vi - input value
4. 	M = SET(H(Km), Vm)
	where
		H - hash function
		SET - set H(Km),Vm to map/storage
5. 	EM = E(K, M)

STORAGE ALGORITHM 'GET'

1. 	M = D(K, EM)
	where
		M - map/storage
2. 	Km = KDF(Ki, S)
	where
		Km - key map/storage
		Ki - input key
3. 	Vm = GET(H(Km))
	where
		GET - get Vm from map/storage by Km
4. 	Vi = D(Km, Vm)

STORAGE ALGORITHM 'DEL'

1. 	M = D(K, EM)
	where
		D - decryption function
		M - map/storage
2. 	Km = KDF(Ki, S)
	where
		Km - key map/storage
		Ki - input key
3. 	M = DEL(H(Km))
	where
		DEL - delete Vm from map/storage by Km
4. 	EM = E(K, M)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IKVStorage added in v1.5.10

type IKVStorage interface {
	GetSettings() ISettings

	Set([]byte, []byte) error
	Get([]byte) ([]byte, error)
	Del([]byte) error
}

func NewCryptoStorage

func NewCryptoStorage(pSettings ISettings) (IKVStorage, error)

type ISettings added in v1.5.9

type ISettings interface {
	GetPath() string
	GetWorkSize() uint64
	GetPassword() string
}

func NewSettings added in v1.5.9

func NewSettings(pSett *SSettings) ISettings

type SSettings added in v1.5.9

type SSettings sSettings

Directories

Path Synopsis
Package database is a key-value database with integrated password encryption functions.
Package database is a key-value database with integrated password encryption functions.

Jump to

Keyboard shortcuts

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