| Nomen Nescio 2004-12-31, 5:45 pm |
| It is a script generating very suspicious messages: encrypted with a randomly
generated strong public key and sent to the publicly available forum
(so the recipent is untraceable).
The Echelon computers should be very busy trying to decrypt it...
#!/usr/bin/python
import base64
import os
import GnuPGInterface
gnupg = GnuPGInterface.GnuPG()
gnupg.options.meta_interactive = 0
# Set recipient to the random e-mail address
recipient='js432@hotmail.com'
recipient_name='John Smith'
print "I'm generating a random message..."
f=open('/dev/random','r')
b=f.read(1)
# Set length of the message below
a=f.read(2435+ord(b))
s=base64.encodestring(a)
a=f.read(103)
passphrase=base64.encodestring(a)
sb="Very suspicious subject "
b=f.read(1)
sb=sb+str(ord(b))
b=f.read(1)
sb=sb+str(ord(b))
b=f.read(1)
sb=sb+str(ord(b))
# Set the key length in Subkey-Length line, 4096 is a good value but the key generation is long
# 1024 - a good value for testing
print "I'm generating a random GPG key..."
proc = gnupg.run(['--gen-key'], create_fhs=['stdin', 'stdout','logger'])
proc.handles['stdin'].write('''Key-Type: DSA
Key-Length: 1024
Subkey-Type: ELG-E
Subkey-Length: 4096
Name-Real: '''+recipient_name+'''
Name-Email: '''+recipient+'''
Expire-Date: 2y
Passphrase: abc
%pubring foo.pub
%secring foo.sec
''')
proc.handles['stdin'].close()
report = proc.handles['logger'].read()
proc.handles['logger'].close()
print report
proc.wait()
print "I'm encrypting the message..."
gnupg.options.armor = 1
gnupg.passphrase = 'abc'
gnupg.options.recipients = [ recipient ]
p1=gnupg.run( ['--encrypt',
'--keyring','./foo.pub',
'--trust-model','always'],create_fhs=['stdin', 'stdout', 'passphrase'])
p1.handles['passphrase'].write(passphrase)
p1.handles['passphrase'].close()
p1.handles['stdin'].write(s)
p1.handles['stdin'].close()
s = p1.handles['stdout'].read()
p1.handles['stdout'].close()
p1.wait()
print s
print "I'm sending a message through the mixmaster chain..."
p=os.popen("mixmaster -s \""+sb+"\" -c 9 -l \*,\*,\*,\* -g alt.test,alt.test.test",'w')
p.write(s)
p.close()
|