database

package
v0.0.0-...-00a43c6 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WORD  = 2
	DWORD = 4
	QWORD = 8
)
View Source
const (
	TLV_TYPE_LEN                = 1
	TLV_LENGTH_LEN              = 2
	MASTER_SEED_LEN             = 32
	TRANSFORM_SEED_LEN          = 32
	INNER_RANDOM_STREAM_KEY_LEN = 32
	STREAM_START_BYTES_LEN      = 32
	MAX_UINT16                  = ^uint16(0)
)
View Source
const (
	// End of headers
	EOH headerCode = iota
	Comment
	CipherID
	CompressionFlag
	MasterSeed
	TransformSeed
	TransformRounds
	EncryptionIV
	ProtectedStreamKey
	StreamStartBytes
	InnerRandomStreamID
	// Store number of header codes so that we can iterate
	NUM_HEADER_CODES
)
View Source
const (
	COMPRESSION_None = 0
	COMPRESSION_GZip = 1
)
View Source
const (
	IRS_None = iota
	IRS_ARC4
	IRS_Salsa20
)

Variables

View Source
var (
	FILE_SIGNATURE    [4]byte  = [4]byte{0x03, 0xD9, 0xA2, 0x9A}
	VERSION_SIGNATURE [4]byte  = [4]byte{0x67, 0xFB, 0x4B, 0xB5}
	AES_CIPHER_ID     [16]byte = [16]byte{0x31, 0xC1, 0xF2, 0xE6, 0xBF, 0x71, 0x43, 0x50, 0xBE, 0x58, 0x05, 0x21, 0x6A, 0xFC, 0x5A, 0xFF}
	// KeePass files contain this sequence as the data for the final header field, we just copy that behavior
	EOH_DATA [4]byte = [4]byte{0x0d, 0x0a, 0x0d, 0x0a}
)

Functions

This section is empty.

Types

type BlockSizeError

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

func (BlockSizeError) Error

func (e BlockSizeError) Error() string

type Database

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

func New

func New(path string) *Database

func (*Database) Decrypt

func (d *Database) Decrypt() error

func (*Database) Load

func (d *Database) Load() error

func (*Database) Parse

func (d *Database) Parse() error

func (Database) Parsed

func (d Database) Parsed() *parser.Document

func (Database) Path

func (d Database) Path() string

func (Database) Plaintext

func (d Database) Plaintext() []byte

func (*Database) Save

func (d *Database) Save() error

func (*Database) SaveToPath

func (d *Database) SaveToPath(path string) error

func (*Database) SetPassword

func (d *Database) SetPassword(password string)

func (*Database) VerifyHeaderHash

func (d *Database) VerifyHeaderHash() (bool, error)

func (Database) Version

func (d Database) Version() version

type FileError

type FileError error

type IRSID

type IRSID int

type ParseError

type ParseError error

Jump to

Keyboard shortcuts

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