database

package
v0.0.0-...-f73c8e4 Latest Latest
Warning

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

Go to latest
Published: May 22, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertPassphraseToKey

func ConvertPassphraseToKey(pass []byte) []byte

func Decrypt

func Decrypt(content []byte, key []byte) ([]byte, error)

Decrypt decrypts a content string using the shared secret key. The inverse operation to message -> Encrypt(message, key).

func DecryptWithPass

func DecryptWithPass(encryptedData, pass []byte) ([]byte, error)

func Encrypt

func Encrypt(message []byte, key []byte) ([]byte, error)

Encrypt gotten from https://github.com/nbd-wtf/go-nostr/blob/master/nip04/nip04.go

func EncryptWithPass

func EncryptWithPass(data, pass []byte) ([]byte, error)

func ReadFromDB

func ReadFromDB(path string, dataStruct Serialiser, pass []byte) error

ReadFromDB Reads data from a file and decrypts its content parsing it into the given Serialiser Interface.

func WriteToDB

func WriteToDB(path string, dataStruct Serialiser, pass []byte) error

Types

type Serialiser

type Serialiser interface {
	Serialise() ([]byte, error)
	DeSerialise([]byte) error
}

Jump to

Keyboard shortcuts

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