]>
Dogcows Code - chaz/p5-File-KDBX/blob - lib/File/KDBX/Cipher/CBC.pm
1 package File
::KDBX
::Cipher
::CBC
;
2 # ABSTRACT: A CBC block cipher mode encrypter/decrypter
9 use File
::KDBX
::Util
qw(:class);
12 extends
'File::KDBX::Cipher';
14 our $VERSION = '0.900'; # VERSION
23 my $mode = $self->{mode
} ||= do {
24 my $m = Crypt
::Mode
::CBC-
>new($self->algorithm);
25 $m->start_encrypt($self->key, $self->iv);
29 return join('', map { $mode->add(ref $_ ? $$_ : $_) } grep { defined } @_);
35 my $mode = $self->{mode
} ||= do {
36 my $m = Crypt
::Mode
::CBC-
>new($self->algorithm);
37 $m->start_decrypt($self->key, $self->iv);
41 return join('', map { $mode->add(ref $_ ? $$_ : $_) } grep { defined } @_);
46 return '' if !$self->{mode
};
47 my $out = $self->{mode
}->finish;
62 File::KDBX::Cipher::CBC - A CBC block cipher mode encrypter/decrypter
70 use File::KDBX::Cipher::CBC;
72 my $cipher = File::KDBX::Cipher::CBC->new(algorithm => $algo, key => $key, iv => $iv);
76 A subclass of L<File::KDBX::Cipher> for encrypting and decrypting data using the CBC block cipher mode.
80 Please report any bugs or feature requests on the bugtracker website
81 L<https://github.com/chazmcgarvey/File-KDBX/issues>
83 When submitting a bug or request, please include a test-file or a
84 patch to an existing test-file that illustrates the bug or desired
89 Charles McGarvey <ccm@cpan.org>
91 =head1 COPYRIGHT AND LICENSE
93 This software is copyright (c) 2022 by Charles McGarvey.
95 This is free software; you can redistribute it and/or modify it under
96 the same terms as the Perl 5 programming language system itself.
This page took 0.037359 seconds and 4 git commands to generate.