File::KDBX::Key(3pm)
π File::KDBX::Key β the glow-up guide π
okay bestie, settle in, because this is the manual page for File::KDBX::Key, straight out of User Contributed Perl Documentation. she's a credential. she protects your KDBX file. she's kind of a big deal π
β¨ VERSION β¨
version 0.906 β yes, we're on 0.906, keep up π
πΈ DESCRIPTION πΈ
so. a master key is one or more credentials that can protect a KDBX database. that's the whole vibe. when you encrypt a database with a master key, you will need the master key to decrypt it. periodt.
keep your master key safe! genuinely. if someone gains access to your master key, they can open your database. and if you forget or lose any part of your master key, all data in the database is lost. like, gone gone. π
there are several different types of keys, and each one is implemented as a subclass:
File::KDBX::Key::Passwordβ password or passphrase, aka knowledge of a string of charactersFile::KDBX::Key::Fileβ possession of a file ("key file") with a secretFile::KDBX::Key::ChallengeResponseβ possession of a device that responds correctly when challengedFile::KDBX::Key::YubiKeyβ possession of a YubiKey hardware device (a type of challenge-response)File::KDBX::Key::Compositeβ one or more keys combined as one
a good master key is produced from a high amount of "entropy" (that's unpredictability, iykyk). the more entropy the better. combining multiple keys into a Composite key combines the entropy of each individual key. for example, if you have a weak password and you combine it with other keys, the composite key is stronger than the weak password key by itself. (of course it's much better to not have any weak components of your master key. like, obviously. π)
COMPATIBILITY NOTE: most KeePass implementations are limited in the types and numbers of keys they support. Password keys are pretty much universally supported. File keys are pretty well-supported. many do not support challenge-response keys. so if you are concerned about compatibility, you should stick with one of these well-supported configurations:
- one password
- one key file
- composite of one password and one key file
π METHODS π
new
$key = File::KDBX::Key->new({ password => $password });
$key = File::KDBX::Key->new($password);
$key = File::KDBX::Key->new({ file => $filepath });
$key = File::KDBX::Key->new(\$file);
$key = File::KDBX::Key->new(\*FILE);
$key = File::KDBX::Key->new({ composite => [...] });
$key = File::KDBX::Key->new([...]); # composite key
$key = File::KDBX::Key->new({ responder => \&responder });
$key = File::KDBX::Key->new(\&responder); # challenge-response key
construct a new key. new key, who dis π
the primitive used to construct the key is not saved but is immediately converted to a raw encryption key (see "raw_key").
a File::KDBX::Key::Composite is somewhat special in that it does retain a reference to its component keys, and its raw key is calculated from its components on demand. she's high maintenance, we love her for it π«Ά
init
$key = $key->init($primitive);
initialize a File::KDBX::Key with a new primitive. returns itself to allow method chaining β¨
reload
$key = $key->reload;
reload a key by re-reading the key source and recalculating the raw key. returns itself to allow method chaining. it's giving refresh, it's giving reboot π
raw_key
$raw_key = $key->raw_key;
$raw_key = $key->raw_key($challenge);
get the raw encryption key. this is calculated based on the primitive(s). the $challenge argument is for challenge-response type keys and is ignored by other types.
NOTE: the raw key is sensitive information and so is memory-protected while not being accessed. if you access it, you shouldmemzeroor "erase" inFile::KDBX::Utilit when you're done. protect her. she's precious. π
hide
$key = $key->hide;
put the raw key in memory protection. does nothing if the raw key is already in memory protection. returns itself to allow method chaining. peek-a-boo, except the opposite π
show
$key = $key->show;
bring the raw key out of memory protection. does nothing if the raw key is already out of memory protection. returns itself to allow method chaining. main character moment unlocked π
is_hidden
$bool = $key->is_hidden;
get whether or not the key's raw secret is currently in memory protection. vibe check π§
π BUGS π
please report any bugs or feature requests on the bugtracker website <https://github.com/chazmcgarvey/File-KDBX/issues>
when submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. help us help you bestie, drop the receipts π
π¦ AUTHOR π¦
Charles McGarvey <ccm@cpan.org> β the icon, the legend, the moment β
π COPYRIGHT AND LICENSE π
this software is copyright (c) 2022 by Charles McGarvey.
this is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay, honestly π
okay that's the whole page!! this was <pink>perl v5.40.1</pink> <lavender>2025-05-04</lavender> <cyan>File::KDBX::Key(3pm)</cyan> β go forth and encrypt responsibly, bestie ππΈβ¨
π¦ where this page comes from
- debian trixie: libfile-kdbx-perl 0.906-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libfile-kdbx-perl 0.906-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libfile-kdbx-perl 0.906-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms