Página 2 de 2

NotaPublicado: 2009-04-06 10:08 @464
por situ
Estoy tratando de realizar un script para desencriptar pero no me funciona. Estoy usando el mismo ejemplo de la web:
http://search.cpan.org/~jesse/GnuPG-Int ... Decryption

Explorer, me podrás dar una mano.
Gracias

NotaPublicado: 2009-04-28 09:49 @451
por situ
Estoy probando otro script y no me funciona.
Sintáxis: [ Descargar ] [ Ocultar ]
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.