in reply to Re^3: Unable to get any decrypted output from $gpg->verify
in thread Unable to get any decrypted output from $gpg->verify
#!/usr/bin/perl use strict ; use Crypt::GPG ; use Archive::Tar ; my $gpg = new Crypt::GPG ; $gpg->gpgbin('/bin/gpg') ; $gpg->secretkey('my_email_address') ; $gpg->passphrase('my_gpg_passphrase') ; $gpg->armor(1) ; my $encryptedFile = '/home/xuo/TheCat.gpg' ; my $tarFile_read = '/home/xuo/TheCat.tar.gz' ; my $tarFile_write = '/home/xuo/TheCat_from_gpg_encrypt.gpg' ; my @encryptedFileArray = () ; my @fileToBeEncrypted = () ; my @fileToBeDecrypted = () ; my @gpgEncryptedFile = () ; open(TAR_FILE, "$tarFile_read") || die "can't open file $tarFile_read +!" ; @fileToBeEncrypted = <TAR_FILE> ; close(TAR_FILE) ; my @gpgEncryptedFile = $gpg->encrypt(\@fileToBeEncrypted, 'my_email_ad +dress') ; open(GPG_FILE, ">$encryptedFile") || die "can't open file $encryptedFi +le !" ; print GPG_FILE "@gpgEncryptedFile" ; close(GPG_FILE) ; open(GPG_FILE, "$encryptedFile") || die "can't open file $encryptedFil +e !" ; @fileToBeDecrypted = <GPG_FILE> ; close(GPG_FILE) ; my ($plaintext, $signature) = $gpg->verify(\@fileToBeDecrypted) ; open(TAR_FILE, ">$tarFile_write") || die "can't open file $tarFile_wri +te !" ; print TAR_FILE "$plaintext" ; close(TAR_FILE) ; exit ;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Unable to get any decrypted output from $gpg->verify
by hippo (Archbishop) on Aug 19, 2023 at 23:01 UTC | |
by xuo (Acolyte) on Aug 22, 2023 at 18:52 UTC | |
by hippo (Archbishop) on Aug 22, 2023 at 21:08 UTC | |
by xuo (Acolyte) on Aug 23, 2023 at 18:41 UTC | |
by cavac (Prior) on Aug 24, 2023 at 10:36 UTC | |
|