Changeset 40 for keysigning
- Timestamp:
- Jul 9, 2007, 9:09:04 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
keysigning/gpg-challenge.pl
r39 r40 19 19 20 20 use strict; 21 use File::Temp qw(tempfile); 21 22 22 23 my $myKeyID="0123456789ABCDEF"; 23 24 my $myEmailAddress="Full Name <name\@example.com>"; 24 25 my $myFirstName="Firstname"; 26 my $policyURL="http://www.example.com/gpg/policy"; 25 27 my $occasion="something"; 26 28 … … 91 93 # Create the encrypted part of the body of the message: 92 94 my $body = << "EOF"; 93 [Weiter unten steht dasselbe auf deutsch.] 95 Hi, 94 96 95 This message is sent as part of my certification process. 96 It is to verify that you, the keyholder of $keyID can read email 97 sent to the associated address 98 $uid 97 You are receiving this email because you gave me your OpenPGP key 98 details for key-signing at $occasion. 99 99 100 Please, now that you have decrypted this message, simply reply to 101 $myEmailAddress 102 quoting 100 This message is a challenge to help verify that you can read email sent 101 to $uid and encrypted to the key with ID $keyID. 103 102 104 > KeyID: $keyID 105 > UserID: $uid 106 > Magic: $challenge 107 > Upload to keyserver after signing: yes 103 You should have received an email for each UID, each containing a random 104 string of data. Please reply from each of the UIDs a message was sent 105 to, including the random string, making sure you sign the message. (You 106 may encrypt your reply, but this is not necessary.) 108 107 109 in the body of your message. 108 After receiving your reply and checking that the challenge string 109 matches the original, I will upload your key to a key server unless you 110 specify otherwise. 110 111 111 If you asked me to certify more than one userid or email address 112 on your key you should receive one of these messages for each 113 address - in that case please send one reply per address, too. 112 My key-signing policy can be found at: 114 113 115 After signing your key I will upload it to the keyserver network 116 unless you oppose. 114 $policyURL 117 115 118 ----- 116 BEGIN CHALLENGE 117 $challenge 118 END CHALLENGE 119 119 120 Diese Nachricht ist Teil meines Zertifizierungsprozesses. Damit 121 überprüfe ich, dass du, der Besitzer des OpenPGP-Schlüssels $keyID, 122 die E-Mail-Adresse 123 $uid 124 kontrollierst. 120 Regards, 121 $myFirstName 122 EOF 125 123 126 Jetzt nachdem du diese Nachricht entschlüsselt hast, sende einfach 127 eine Antwort an 128 $myEmailAddress 129 wobei du Folgendes zitierst: 130 131 > KeyID: $keyID 132 > UserID: $uid 133 > Magic: $challenge 134 > Schlüssel nach dem Signieren hochladen: ja 135 136 Falls du mich gebeten hast, mehrere UserIDs oder E-Mail-Adressen zu 137 zertifizieren, dann solltest du für jede Adresse eine dieser Nachrichten 138 erhalten. In diesem Fall sende bitte für jede Nachricht eine separate 139 Antwort. 140 141 Nachdem ich deinen Schlüssel signiert habe, werde ich ihn auf einen 142 oder mehrere Keyserver hochladen, sofern du dem nicht widersprichst. 143 EOF 144 # encrypt the message 145 my $tempfile="$keyID.ttt"; 146 open( GPG, "|gpg --batch --encrypt --armor --textmode -r 0x$myKeyID \ 147 --encrypt-to $keyID >$tempfile" ) || die "Cannot run gpg\n"; 148 print GPG $body; 149 close GPG; 150 open( FILE, $tempfile ) 151 || die "File '$tempfile' doesn't exist\n"; 152 my $encbody; 153 while ( <FILE> ) 154 { 155 $encbody .= $_; 156 } 157 close FILE; 158 unlink $tempfile; 159 160 $body = << "EOF"; 161 [Weiter unten steht dasselbe auf deutsch.] 162 163 Hi! 164 165 You are being sent this message because we exchanged OpenPGP key 166 fingerprints at $occasion and you asked me to sign your 167 key(s). 168 169 Please decrypt the encrypted message for instructions on how to 170 complete the certification protocol. 171 172 If you don't know what I'm talking about, then please reply to me as 173 soon as possible, since someone other than yourself tried to make me 174 certify that the OpenPGP key with ID 0x$keyID does belong to you. 175 In other words, someone tried to STEAL YOUR IDENTITY. 176 177 Regards 178 $myFirstName 179 180 ----- 181 182 Hallo! 183 184 Wir haben in $occasion Fingerprints unserer OpenPGP-Schlüssel 185 ausgetauscht, und du hast mich gebeten, deinen Schlüssel zu 186 signieren. 187 188 Die folgende verschlüsselte Nachricht erklärt, was du tun musst, damit 189 ich deinen Schlüssel zertifiziere. 190 191 Falls du nicht weißt, wovon ich rede, dann solltest du mich umgehend 192 darüber informieren, da in diesem Fall jemand versucht deine E-Mail- 193 Adresse als seine zu verkaufen. 194 195 Viele Grüße 196 $myFirstName 197 198 EOF 199 $body .= $encbody; 200 #open( MAIL, "|mail -s \"OpenPGP key exchange formalities\" \"$uid\"" ) 201 # || die "Cannot run mail\n"; 202 #print MAIL $encbody; 203 #close MAIL; 204 205 # using DCOP interface 206 # openComposer( QString to, QString cc, QString bcc, 207 # QString subject, QString body, bool hidden ) 208 open ( DCOP , "dcop kmail default openComposer \"$uid\" \"\" \"\" \"OpenPGP \ 209 key certification challenge\" \"$body\" false|" ) || die "Cannot access Kmail DCOP \ 210 interface\n"; my $dcopRef = <DCOP>; 211 close DCOP; 212 chomp $dcopRef; 213 124 my ($tmp_fh, $tmp_fname) = tempfile(); 125 print $tmp_fh $body; 126 close $tmp_fh; 127 system ( "mutt -e \"set pgp_autosign=yes;set pgp_autoencrypt=yes\" -i \"$tmp_fname\" -s \"OpenPGP UID verification\" -- \"$uid\"" ); 214 128 print "$challenge: $uid ($keyID)\n"; 215 129 }
Note: See TracChangeset
for help on using the changeset viewer.