File::...Stream(3pm)

๐Ÿ“ฆ
version 0.906 ยท 4 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

๐Ÿ’– File::KDBX::Cipher::Stream โ€” the whole vibe ๐Ÿ’–

okay so bestie, you found it: this is the manual page for File::KDBX::Cipher::Stream, straight outta the User Contributed Perl Documentation, and the page itself gets filed under the lil' abbreviated name File::...Stream(3pm) (she's got a long government name, it's fine). grab a snack, we're doing stream ciphers ๐Ÿฆ‹


โœจ VERSION โœจ

version 0.906 โ€” yes she's got a version, she's official, slay ๐Ÿ‘‘


๐ŸŒธ SYNOPSIS ๐ŸŒธ

the whole personality in four lines, no cap:

use File::KDBX::Cipher::Stream;

my $cipher = File::KDBX::Cipher::Stream->new(algorithm => $algorithm, key => $key, iv => $iv);

literally that's it. build her, then she's ready ๐Ÿ’…


๐Ÿซถ DESCRIPTION ๐Ÿซถ

so File::KDBX::Cipher::Stream is a subclass of File::KDBX::Cipher, and what she does โ€” her entire job, her main character moment โ€” is encrypting and decrypting data using a stream cipher. that's the assignment and she ate, fr fr ๐Ÿ”ฅ


๐ŸŽ€ ATTRIBUTES ๐ŸŽ€

counter

$counter = $cipher->counter;

get the initial counter / block count into the keystream ๐Ÿงฎ like, where in the keystream she's starting from, block-wise.

offset

$offset = $cipher->offset;

get the initial byte offset into the keystream ๐ŸŒˆ one byte at a time, precise lil' thing.

real talk tho: this one has precedence over "counter" if both are set. so if you set both?? offset wins, periodt. no drama, just rules. ๐Ÿ‘‘

๐Ÿ’œ METHODS ๐Ÿ’œ

crypt

$ciphertext = $cipher->crypt($plaintext);
$plaintext = $cipher->crypt($ciphertext);

encrypt or decrypt some data ๐Ÿซง and here's the iconic part: these ciphers are symmetric, so encryption and decryption are literally the same operation. you hand her plaintext, you get ciphertext. you hand her ciphertext, you get plaintext. she's ambidextrous, she doesn't care, she's just that girl ๐Ÿ’…

oh and also? this method is an alias for both "encrypt" in File::KDBX::Cipher and "decrypt" in File::KDBX::Cipher. two names, one function, we love a versatile queen ๐Ÿ‘‘

keystream

$stream = $cipher->keystream;

access the keystream ๐ŸŒŠ the actual stream of bytes doing the work. peek at it, it's right there, it's not shy.

dup

$cipher_copy = $cipher->dup(%attributes);

get a copy of an existing cipher โ€” except with the counter reset ๐Ÿ”„ โ€” and optionally slap some new attributes on while you're at it (%attributes, look at her being flexible). a lil' clone with amnesia about the counter. iconic behavior honestly ๐Ÿงš


๐Ÿ˜ญ BUGS ๐Ÿ˜ญ

bestie. if something's broken, please don't suffer in silence.

and when you submit a bug or a request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature ๐Ÿ™ˆ like, show us the receipts, we cannot debug a vibe alone.


๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

Charles McGarvey <ccm@cpan.org> โ€” the legend, the author, we stan. ๐Ÿ’–


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. โœจ (free software, free as in go off, fr fr)


aaaand that's the whole page, we're done here ๐ŸŽ€ this was perl v5.40.1, dated 2025-05-04, and it's the File::...Stream(3pm) page โ€” bye bestie, encrypt responsibly, mwah ๐Ÿ’œ

๐Ÿ“ฆ where this page comes from