pdb header collects all data found in the database and verifies that everything is okay
before going any further w parsing, the header object can b found in
armour.pdb.header
, the PdbHeader
class
PdbHeader
takes these arguments and has these properties :
password
-- the database passwordsalt
-- the database salt valuemagic
-- the database magicversion
-- the database versionhash_id
-- the database hash idzstd_comp_lvl
-- the zstd compression levelhash_salt_len
-- the hash selt length used in hashes and encryptionkdf_passes
-- passes for pbkdf2sec_crypto_passes
-- secure encryption passesisec_crypto_passes
-- insecure encryption passesaes_crypto_passes
-- aes encryption passesentries_hash
-- entries hashentries
-- the entries themselvesdb_hash
-- the database hashencrypted
-- is the database encrypted (True
by default )
although ull probably wanna use PdbHeader.from_db()
or PdbHeader.empty()
functions
rather than constructing the db urself
PdbHeader
provides these instance and class methods :
dds(hash_id: int) -> int
-- returns the hash digest size based off thehash_id
ds(hash_id: int) -> int
-- returns the hash digest size together w salt lengthPdbHeader.empty(password: bytes = b"", salt: bytes = b"")
-- returns an unencrypted empty databasePdbHeader.from_db(db: bytes, password: bytes = b"", salt: bytes = b"")
-- create aPdbHeader
from a pDB databasehash_entries()
-- hashes the entries and returns their hashhash_db(db: bytes)
-- hash a database and return its hashto_db()
-- creates a database wout a database hashto_pdb()
-- create a full pDB database ( what u wanna use when dumping )encrypt()
-- encrypts the database entries ( so the db itself )decrypt()
-- decrypts the database entries ( so the db itself )
>>> import armour
>>> print(armour.pdb.header.PdbHeader.empty().encrypt())
version 0
magic b'pDB\xf6'
hash_id 0 ( 'sha3-512' )
zstd_comp_lvl 22 ( ~100.00% )
hash_salt_len 19
kdf_passes 384000
sec_crypto_passes 8
isec_crypto_passes 64
aes_crypto_passes 8
entries_hash <... 0 bytes>
entries <... 3917 bytes>
db_hash <... 0 bytes>
encrypted True
digest_size 83