NAME
CTK::Crypt - Cryptography frontend module
VERSION
Version 1.73
SYNOPSIS
use CTK::Util qw/gpg_init gpg_encrypt gpg_decrypt/;
my $gpg_instance = 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");
gpg_encrypt(
-infile => "MyDocument.txt",
-outfile=> "MyDocument.txt.asc",
-armor => "yes",
) or die( $CTK::Crypt::ERROR );
gpg_decrypt(
-infile => "MyDocument.txt.asc",
-outfile=> "MyDocument.txt",
) or die( $CTK::Crypt::ERROR );
tcd_encrypt( "file.txt", "file.tcd" )
or die( $CTK::Crypt::ERROR );
tcd_decrypt( "file.tcd", "file.txt" )
or die( $CTK::Crypt::ERROR );
DESCRIPTION
Cryptography frontend module
- gpg_init
-
my $gpg_instance = 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
See CTK::Crypt::GPG
- gpg_decrypt
-
$gpg_instance->decrypt( -infile => "MyDocument.txt.asc", -outfile=> "MyDocument.txt", ) or die( $CTK::Crypt::ERROR );
GPG (PGP) Decrypting the files
See CTK::Crypt::GPG
- gpg_encrypt
-
$gpg_instance->encrypt( -infile => "MyDocument.txt", -outfile=> "MyDocument.txt.asc", -armor => "yes", ) or die( $CTK::Crypt::ERROR );
GPG (PGP) Encrypting the files
See CTK::Crypt::GPG
- tcd_decrypt
-
tcd_decrypt( "file.tcd", "file.txt" ) or die( $CTK::Crypt::ERROR );
TCD04 Decrypting files
- tcd_encrypt
-
tcd_encrypt( "file.txt", "file.tcd" ) or die( $CTK::Crypt::ERROR );
TCD04 Encrypting files
TAGS
- :all
-
Will be exported all functions
- :tcd04
-
Will be exported following functions:
tcd_encrypt, tcd_decrypt
- :gpg
-
Will be exported following functions:
gpg_init, gpg_encrypt, gpg_decrypt
HISTORY
See Changes
file
DEPENDENCIES
CTK::Crypt::GPG, CTK::Crypt::TCD04
TO DO
See TODO
file
BUGS
* none noted
SEE ALSO
CTK::Crypt::GPG, CTK::Crypt::TCD04
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/