The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

CTK::Plugin::Crypt - Cryptography plugin

VERSION

Version 1.00

SYNOPSIS

    use CTK;
    my $ctk = new CTK(
            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 http://www.gnupg.org (GPG4Win - http://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, http://www.gnupg.org, GPG4Win

AUTHOR

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

COPYRIGHT

Copyright (C) 1998-2019 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/