NAME

CTK::Plugin::Crypt - Cryptography plugin

VERSION

Version 1.01

SYNOPSIS

use CTK;
my $ctk = CTK->new(
        plugins => "crypt",
    );

my $gpg_instance = $ctk->gpg_init(
    -gpgbin     => "/usr/bin/gpg",
    -gpghome    => "/gpg/homedir",
    -gpgconf    => "/gpg/homedir/gpg.conf",
    -gpgopts    => ["verbose", "yes"],
    -publickey  => "/path/to/public.key",
    -privatekey => "/path/to/private.key",
    -password   => "passphrase", # Key password
    -recipient  => "anonymous@example.com", # Email, user id, keyid, or keygrip
) or die("Can't create crypter");

$ctk->gpg_encrypt(
    -infile => "MyDocument.txt",
    -outfile=> "MyDocument.txt.asc",
    -armor  => "yes",
) or die( $self->error );

$ctk->gpg_decrypt(
    -infile => "MyDocument.txt.asc",
    -outfile=> "MyDocument.txt",
) or die( $self->error );

$ctk->tcd_encrypt( "file.txt", "file.tcd" )
    or die( $self->error );

$ctk->tcd_decrypt( "file.tcd", "file.txt" )
    or die( $self->error );

DESCRIPTION

Cryptography plugin

See https://www.gnupg.org/ (GPG4Win - https://www.gpg4win.org/) for details

METHODS

gpg_init
my $gpg_instance = $ctk->gpg_init(
    -gpgbin     => "/usr/bin/gpg",
    -gpghome    => "/gpg/homedir",
    -gpgconf    => "/gpg/homedir/gpg.conf",
    -gpgopts    => ["verbose", "yes"],
    -publickey  => "/path/to/public.key",
    -privatekey => "/path/to/private.key",
    -password   => "passphrase", # Key password
    -recipient  => "anonymous@example.com", # Email, user id, keyid, or keygrip
) or die("Can't create crypter");

Initialize GPG instance. NOTE! It is GLOBAL object!

For using self object please use CTK::Crypt::GPG module

See CTK::Crypt::GPG

gpg_decrypt
$ctk->gpg_decrypt(
    -infile => "MyDocument.txt.asc",
    -outfile=> "MyDocument.txt",
) or die( $self->error );

GPG (PGP) Decrypting the files

See CTK::Crypt::GPG

gpg_encrypt
$ctk->gpg_encrypt(
    -infile => "MyDocument.txt",
    -outfile=> "MyDocument.txt.asc",
    -armor  => "yes",
) or die( $self->error );

GPG (PGP) Encrypting the files

See CTK::Crypt::GPG

tcd_decrypt
$ctk->gpg_decrypt(
    -infile => "MyDocument.txt.asc",
    -outfile=> "MyDocument.txt",
) or die( $self->error );

TCD04 Decrypting the files

See CTK::Crypt::TCD04

tcd_encrypt
$ctk->tcd_encrypt( "file.txt", "file.tcd" )
    or die( $self->error );

TCD04 Encrypting the files

See CTK::Crypt::TCD04

HISTORY

See Changes file

DEPENDENCIES

CTK, CTK::Plugin, CTK::Crypt

TO DO

See TODO file

BUGS

* none noted

SEE ALSO

CTK, CTK::Plugin, CTK::Crypt, GnuPG, GPG4Win

AUTHOR

Serż Minus (Sergey Lepenkov) https://www.serzik.com <abalama@cpan.org>

COPYRIGHT

Copyright (C) 1998-2022 D&D Corporation. All Rights Reserved

LICENSE

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

See LICENSE file and https://dev.perl.org/licenses/