File::...acBlock(3pm)
β¨ NAME β¨
File::KDBX::IO::HmacBlock β ok so it's an HMAC block stream IO handle, bestie π it's a Perl thing, manual page name File::...acBlock(3pm), and it's lowkey one of the coolest little layered handles out there.
πΈ VERSION πΈ
version 0.906 β yes queen, we're on that version, no cap π
π¦ DESCRIPTION π¦
So here's the vibe: when you write to a HMAC-block stream handle, it takes your data and glows it up into a whole series of blocks. Each block gets its own HMAC calculated, and that HMAC gets tucked right into the output. Data integrity AND authenticity, periodt. π
When you read from a handle, every single block gets verified and authenticated as the blocks get disassembled back into a normal data stream. It's giving main character energy β the handle literally will not let a fake block slide.
This whole format is what helps ensure data integrity and authenticity of KDBX4 files. iykyk π₯
Every block is encoded like this, fr fr:
- HMAC β
32bytes, calculated over [block index (increments starting with 0), block size and data] - Block size β little-endian unsigned 32-bit (and it's counting only the data, okay? not the HMAC, not the size field itself)
- Data β string of bytes
π And the terminating block? It's an empty block, encoded exactly as usual, except the block size is 0 and there's just no data. That's how you know the stream is done. Goodbye, bestie π
π ATTRIBUTES π
π block_size
Desired block size when writing. The default is $File::KDBX::IO::HmacBlock::BLOCK_SIZE or 1,048,576 bytes. Cute, generous, one megabyte of chunkiness. β¨
π key
The HMAC-SHA256 key for authenticating the data stream. This one is required, babe β no key, no authentication, no entry. π«π
π METHODS π
π§ new
$fh = File::KDBX::IO::HmacBlock->new(%attributes);
$fh = File::KDBX::IO::HmacBlock->new($fh, %attributes);
Construct a brand new HMAC-block stream IO handle. You can pass attributes on their own, or hand it an existing $fh first and then the attributes. Build your little stream wrapper and go off ππ¦
π BUGS π
Please report any bugs or feature requests on the bugtracker website <https://github.com/chazmcgarvey/File-KDBX/issues> β the maintainer wants to hear from you, bestie, fr fr.
And when you submit a bug or a request, please include a test-file, or a patch to an existing test-file, that shows off the bug or the feature you're craving. Receipts! Evidence! We love a reproducible queen. ππ
π«Ά AUTHOR π«Ά
Charles McGarvey <ccm@cpan.org> β iconic, legendary, wrote the whole thing. π
π 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, that's the good open-source license energy. πΈ
β And that's the whole page, girlies β this manual page came to you fromperl v5.40.1, dated2025-05-04, and it's on its way to being your fave IO handle. Byeeee π β¨
π¦ 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