🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.privacy.anon-server
Article #238250

fingerprint2aam (was: Proof of Concept Nymserver)

#238250
From: starwars
Date: Sat, 01 May 2010 17:27
70 lines
3721 bytes
> > In case you hacked together the outline in Python, I already have
> > twenty-something lines of code for parsing an input message,
> > retrieving the key, and encrypting the message to it.
> > I tried that out of curiosity after I had a similar idea, but
> > lacking a server I did not have any use for it. It was surprisingly
> > simple in Python using GnuPGInterface, but  I'd be more than happy
> > to share the code with you.
> Thanks, I'd be interested to see it.  The server is written in Python
> and does use GnuPGinterface.

Please find the relevant snippet below. I took the liberty of using 
the GnuPGinterface methods as starting point which you already 
wrote yourself for nymgrind. I do not think there is a benefit in 
having the gateway sign each message, so I changed SignCrypt to 
just Encrypt.

The keys are retrieved each time from the key server (specified in 
gpg.conf), so the keyring could be emptied regularly. However, 
neither the keys are secret, since they are publicly available at 
the key servers, nor is the fact that they received a message, 
since this very message is publicly visible in a.a.m.

----- snippet below here -----

import GnuPGInterface

import config

gnupg = GnuPGInterface.GnuPG()

def Encrypt(recipient, payload):
    recipients = []
    recipients.append(recipient)
    gnupg.options.armor = 1
    gnupg.options.meta_interactive = 0
    gnupg.options.always_trust = 1
    gnupg.options.recipients = recipients
    gnupg.options.homedir = config.keyring
    proc = gnupg.run(['--encrypt'], create_fhs=['stdin', 'stdout'])
    proc.handles['stdin'].write(payload)
    proc.handles['stdin'].close()
    ciphertext = proc.handles['stdout'].read()
    proc.handles['stdout'].close()
    return ciphertext


def ReceiveKey(recipient):
    gnupg.options.meta_interactive = 0
    gnupg.options.homedir = config.keyring
    idlist = []
    idlist.append(recipient)
    proc = gnupg.run(['--recv-keys'], args=idlist, 
create_fhs=['stdout'])
    stdouttmp = proc.handles['stdout'].read()
    proc.handles['stdout'].close()

import email

def EncryptGateway(plaintext):
    message = email.message_from_string(plaintext)
    to = email.Header.decode_header(message['to'])[0][0]
    recipient = re.search('([a-fA-F0-9]{40,40})@', to).group(1)
    if recipient:
      ReceiveKey(recipient)
      return Encrypt(recipient, plaintext)
    else:
      return None

----- snippet ends here -----
Technical Details
Message-ID: <3bd497ec6efb04361833a0f3de288b2e@tatooine.homelinux.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-alt.privacy.anon-server.20141023.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!usenet-fr.net!proxad.net!feeder1-2.proxad.net!news.wiretrip.org!news.bananasplit.info!mail2news
References: <slrnhtmg56.bt0.admin@fleegle.mixmin.net> <1f38766ea7b5bd0af607b6914753aa20@dizum.com> <slrnhtodss.bt0.admin@fleegle.mixmin.net>

Show Full Headers
Complete Article Headers
Message-ID: <3bd497ec6efb04361833a0f3de288b2e@tatooine.homelinux.net>
Subject: fingerprint2aam (was: Proof of Concept Nymserver)
Date: Sat, 01 May 2010 17:27:13 +0000
From: starwars <nonscrivetemi@tatooine.homelinux.net>
References: <slrnhtmg56.bt0.admin@fleegle.mixmin.net> <1f38766ea7b5bd0af607b6914753aa20@dizum.com> <slrnhtodss.bt0.admin@fleegle.mixmin.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-alt.privacy.anon-server.20141023.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!usenet-fr.net!proxad.net!feeder1-2.proxad.net!news.wiretrip.org!news.bananasplit.info!mail2news
Message: This is a Type II anonymous message, sent to you by the Winston Smith
 Project StarwarS mixmaster server at pboxmix.winstonsmith.info.
 If you do not want to receive anonymous messages, please contact
 pbox-admin@winstonsmith.info.
Newsgroups: alt.privacy.anon-server
X-Abuse-Contact: abuse@bananasplit.info
Organization: Bananasplit - Mail2News
Injection-Info: mail2news.bananasplit.info
Lines: 70