Crypt-OpenSSL3

 view release on metacpan or  search on metacpan

lib/Crypt/OpenSSL3/Cipher.pm  view on Meta::CPAN

package Crypt::OpenSSL3::Cipher;
$Crypt::OpenSSL3::Cipher::VERSION = '0.010';
use strict;
use warnings;

use Crypt::OpenSSL3;

1;

# ABSTRACT: an abstraction around ciphers

__END__

=pod

=encoding UTF-8

=head1 NAME

Crypt::OpenSSL3::Cipher - an abstraction around ciphers

=head1 VERSION

version 0.010

=head1 SYNOPSIS

 my $cipher = Crypt::OpenSSL3::Cipher->fetch('AES-128-GCM');
 my $context = Crypt::OpenSSL3::Cipher::Context->new;
 $context->init($cipher, $key, $iv, 1);
 my $ciphertext = $context->update($plaintext);
 $ciphertext .= $context->final;
 my $tag = $context->get_aead_tag(16);

 my $context2 = Crypt::OpenSSL3::Cipher::Context->new;
 $context2->init($cipher, $key, $iv, 0);
 my $decoded = $context2->update($ciphertext);
 $context2->set_aead_tag($tag);
 $decoded .= $context2->final // die "Invalid tag";

=head1 DESCRIPTION

This class holds a symmetric cipher. It's used to create a L<cipher context|Crypt::OpenSSL3::Cipher::Context> that will do the actual encryption/decryption.

=head1 METHODS

=head2 fetch

=head2 get_block_size

=head2 get_description

=head2 get_iv_length

=head2 get_key_length

=head2 get_mode

=head2 get_name

=head2 get_nid

=head2 get_param

=head2 get_type

=head2 is_a

=head2 list_all_provided

=head2 names_list_all

=head1 AUTHOR

Leon Timmermans <fawaka@gmail.com>

=head1 COPYRIGHT AND LICENSE

This software is Copyright (c) 2025 by Leon Timmermans.

This is free software, licensed under:

  The Apache License, Version 2.0, January 2004

=cut



( run in 0.353 second using v1.01-cache-2.11-cpan-389fe586d7c )