|< 1 2 >| | 11 Einträge, 2 Seiten |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/perl
use Data::Dumper;
use Crypt::OpenPGP;
my $pgp = Crypt::OpenPGP->new(Compat => 'GnuPG',
PubRing => '/root/.gnupg/pubring.gpg',
SecRing => '/root/.gnupg/secring.gpg',
ConfigFile => '/root/.gnupg/gpg.conf',
);
my $plain = 'hallo';
my $key_id="7B9635D9";
my $ciphertext = $pgp->encrypt(
Data => $plain,
Recipients => $key_id,
Armour => 1,
);
open (CIFI, ">cifi.gpg");
print CIFI $ciphertext;
close (CIFI);
my $result = $pgp->handle( Filename => 'cifigpg.gpg' );
print Dumper($result);
die "Decryption failed: ", $pgp->errstr unless $pt;
my $result = $pgp->handle( Filename => 'cifigpg.gpg' );
my $result = $pgp->handle( Filename => 'cifi.gpg' );
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.0 (MingW32)
Comment: Powered by e.Crypt (c) DIaLOGIKa / sak 2002-2005
mQENBEK38BABCACoI2iksnccWelaKZD5Qu0lv8SdoVEEwzKHVHbsVxNTCKNfNsQf
YeryhDYqWbcnAKfC1aZUkfr6eM3kL+Xtrm37Dd8CMDnbB39FG/xGwcTLk1d10GHA
M9kG+8hVmp3kZ6CIRY/xB1X3vC1EjLSso64JhnfTdkZoctanC6m46jpkXxGEaxn1
N7jRKHFJOecHBTqUwd0vmxlxnTWNb4B58iwugEFVBsxt5kJTSRcEA/B5FRiYUIEt
XCTL5Ss1b9H37pXAlzwizUZFSi1Wedv8nKNQhoRMfuJwWP/lPeZsUy1bJGYpepuv
meAlJ7ABavzWKkpPjjgTjEipsMZdZYLIyd0DABEBAAG0KlNhc2NoYSBLaWVmZXIg
PHNhc2NoYS5raW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ag4/kvmrvund9+IKS3Wum1j7N698xSU6VchLoK+D
58XYCKwXWtMS6A0Km38QoAEEkyU/Y4/8ScJ7B6XNgAPg0GEfF/A/eFhHPugtNeuZ
rAxmgt3wB3yYjSvSg7k7G05TDL1oJ7wQEQ==
=hgp4
-----END PGP PUBLIC KEY BLOCK-----
1
2
3
4
5
6
7
8
9
10
11
12
-----BEGIN PGP MESSAGE-----
Version: GnuPG v1.2.1 (MingW32) - WinPT 0.7.96rc1
hQEMA/dw9T1eEZ3kAQf/V8hp53xaQT9I7JHN4tsOWKLE9N5OZ398mElWd62dKkIJ
NCuilnrIDFe/C6HEGquYxDlLcBsD+HyewSQONwkY9CPzgcKaQ9m5ox15sHUQF1uN
F979oV5cuQfOzmNQcEDoVCPyhle69FAaB2dFYwNDAHwNo/aoj/of+DqVP1TSbi/2
DULehOsD/spsZeANuNK/A3AW9bM4jDh+n5jh9GbGHU1LJimn3LOd9cMHcDjWm3Qu
J3WdlqFAf8iS7aWanUFgD8gAJYlwcwAcgfMbVwNNTSPFR9498HMHsC2GFJlGbfrn
BmnFKgORObB5hJvQpDAcuqcAWX2aAmvVS5PzsIaE08kv/yOD9dQuTkfwAnSlx4pO
Z9jLCOyrKpwQ4mfpiyoX+Nss9x/sT8XeQy74bDKnG/s=
=GAhg
-----END PGP MESSAGE-----
1
2
3
4
5
6
7
8
9
10
11
12
13
-----BEGIN PGP MESSAGE-----
Version: Crypt::OpenPGP 1.03
hQEMA6brmI9Z9tTGAQf/R4nv50z/WaP+dd1Q6QpPnmkGuZFrsS4sIv032L/AI0Rg
biU86z7VouERC5Zb6VKL/LGgHKz8PxSzrgzh53fAS1jkTb75X25H9hTCn9RFUNVc
QFmbRrAQbMtMX2ThAx+Cov9HFgBOkAY2t8Y2Yq55mL+ransDBlJZmR1R78mPk13o
/ar852NeS5lVZGMVZDe8Vd58fCLHfKNMTUFbpvVAU5kBjis0Jt0wJsaKbf1u7xFl
xjmX0IkAwn04lCsLYQyJSZTv0ym5VJ1yE1K0dNMcKLhY08YCnC82X5ovQR7DIXkX
hKQUCdBKnDGRUWOxzF1d/OOJFyPhXVI4uHJv6gV9tdJBAcKMXujCp0HSH9KLvMC4
sM8GbOkNczm6bhoZssb7LTUBO73nsQ+hkGmN8lakhRTwhURLr3o2i6q+Aen+2x5G
100=
=bPpO
-----END PGP MESSAGE-----
gpg.exe --status-fd 1 --yes --decrypt
1
2
3
4
5
6
7
[GNUPG:] ENC_TO F770F53D5E119DE4 1 0
gpg: encrypted with RSA key, ID 5E119DE4
[GNUPG:] NO_SECKEY F770F53D5E119DE4
[GNUPG:] BEGIN_DECRYPTION
[GNUPG:] DECRYPTION_FAILED
gpg: decryption failed: secret key not available
[GNUPG:] END_DECRYPTION
1
2
3
4
5
6
[GNUPG:] ENC_TO A6EB988F59F6D4C6 1 0
gpg: encrypted with RSA key, ID 59F6D4C6
[GNUPG:] NO_SECKEY A6EB988F59F6D4C6
[GNUPG:] BEGIN_DECRYPTION
[GNUPG:] DECRYPTION_FAILED
gpg: decryption failed: secret key not available
gpg --list-keys
1
2
3
4
5
6
7
8
C:/Documents and Settings/xxxxx/Application Data/GnuPG\pubring.gpg
--------------------------------------------------------------------
pub 1024R/7B9635D9 2006-04-18 Mein Name <mein.name@gmx.de>
sub 1024R/B54BBB91 2006-04-18 [verfällt: 2007-04-18]
pub 2048R/59F6D4C6 2005-06-21 Sascha Kxxxxx <sascha.kxxxxx@diaxxxika.de>
uid Sascha Kxxxxxx <sak@diaxxxika.de>
sub 2048R/5E119DE4 2005-06-21
|< 1 2 >| | 11 Einträge, 2 Seiten |