Estoy probando otro script y no me funciona.
Using perl Syntax Highlighting
use IO
::Handle;
use GnuPG
::Interface;
my ($gnupg);
$file = "hola.gpg";
open(INFO
, $file);
my $xmlDataIn = @lines;
print "$xmlDataIn";
my $passphrase = "123456";
$gnupg = GnuPG
::Interface->new();
$gnupg->call('/usr/bin/gpg');
$gnupg->options->meta_interactive(1
);
$gnupg->options->homedir('/root/.gnupg');
$gnupg->options->extra_args('--no-secmem-warning');
my ($input,$output,$error,$passphrase_fh,$status_fh) =
(IO
::Handle->new(),IO
::Handle->new(),IO
::Handle->new(),IO
::Handle->new(),IO
::Handle->new());
my $handles = GnuPG
::Handles->new(stdin
=> $input,stdout
=>
$output,stderr
=> $error,passphrase
=> $passphrase_fh,status
=>
$status_fh);
foreach my $handle ($input,$output,$error,$passphrase_fh,$status_fh) {
$handle->autoflush(1
);
}
my $pid = $gnupg->decrypt(handles
=> $handles);
print $passphrase_fh $passphrase;
close $passphrase_fh;
print $input $xmlDataIn;
close $input;
my $decryptedText = <$output>;
my @error = <$error>;
my @status_info = <$status_fh>;
close $output;
close $error;
close $status_fh;
waitpid $pid, 0;
print "$decryptedText<br>\n";
print "@error<br>\n";
print "@status_info<br>\n";Coloreado en 0.003 segundos, usando
GeSHi 1.0.8.4
El archivo hola.pgp contiene un párrafo
encriptado.
- Código: Seleccionar todo
Error:
bitacora:/home/seguridad# perl desencriptar.pl
0Reading passphrase from file descriptor 10
<br>
gpg: no se han encontrados datos OpenPGP válidos
gpg: decrypt_message failed: eof
<br>
[GNUPG:] NODATA 1
[GNUPG:] NODATA 2
<br>
¿Alguien me puede ayudar?
Gracias.