NAME

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

VERSION

version 0.001

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";

DESCRIPTION

This class holds a symmetric cipher. It's used to create a cipher context that will do the actual encryption/decryption.

METHODS

fetch

get_block_size

get_description

get_iv_length

get_key_length

get_mode

get_name

get_nid

get_param

get_type

is_a

list_all_provided

names_list_all

AUTHOR

Leon Timmermans <fawaka@gmail.com>

COPYRIGHT AND LICENSE

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

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.