Article View: news.software.nntp
Article #85540Re: X-Trace Header Hashing?
From: Tony
Date: Wed, 05 Jun 2013 22:14
Date: Wed, 05 Jun 2013 22:14
68 lines
3720 bytes
3720 bytes
In news.software.nntp, Jesse <jesse.rehmer@blueworldhosting.com> wrote:
>On 2013-06-05 20:57:33 +0000, Tony said:
>
>> You can't decode hashes. If you want two way you need to use one of the
>> encryption libraries instead. Be warned, the strings you end up with will
>> be longer.
>
>Thanks for the example, I will give this a shot. All of the examples
>I've found online use a one-way hash as well, but I figured most admins
>would want a way to be able to see the original content in case of
>abuse/DMCA violations. I couldn't think of a possible way to do that
>with all of the examples I have seen, but assumed admins had some way
>of doing so in order to trace it back if needed.
The Albasani stuff,
http://svn.schnuerpel.eu/viewvc.cgi/trunk/?root=schnuerpel
uses encryption rather than hashing.
This is the filter_nnrpd.pl file,
http://svn.schnuerpel.eu/viewvc.cgi/trunk/etc/filter/filter_nnrpd.pl?view=markup&root=schnuerpel
Which calls encrypt_headers, which is here,
http://svn.schnuerpel.eu/viewvc.cgi/trunk/lib/Schnuerpel/INN/Filter.pm?view=markup&root=schnuerpel
You want sub encrypt_headers_1036 for INN 2.5.x,
It basically calls encode, which is here,
http://svn.schnuerpel.eu/viewvc.cgi/trunk/lib/Schnuerpel/Crypt.pm?view=markup&root=schnuerpel
use Crypt::Rijndael();
use MIME::Base64();
sub encode($;$)
######################################################################
{
my $line = shift || confess;
my $time = shift;
# add one for line feed
my $l = 1 + length($line);
my $keysize = KEYSIZE;
# round up to next multiple of KEYSIZE, which must be a power of two
# MIN_PADDING is some integer greater 0
my $padding = (($l + MIN_PADDING + $keysize) & ~($keysize - 1)) - $l;
my $p = chars($padding, $padding);
return MIME::Base64::encode_base64(
getCipher($time)->encrypt($p . "\n" . $line),
''
);
}
You can basically use the whole Albasani library as-is to do most of the
work if you want, although it's quite heavy for just encrypting a few
headers.
--
Tony Evans
Saving trees and wasting electrons since 1993
blog -> http://perceptionistruth.com/
books -> http://www.bookthing.co.uk/
[ anything below this line wasn't written by me ]
Technical Details
Message-ID:
<kood6j$98p$1@matrix.darkstorm.co.uk>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.dca3.giganews.com!border2.nntp.dca3.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!news.bbs-scene.org!news.unit0.net!matrix.darkstorm.co.uk!.POSTED!not-for-mailReferences:
<koisur$usg$1@nnrp.blueworldhosting.com> <koj52n$i2d$1@matrix.darkstorm.co.uk> <slrnkqrclv.ceu.steve@snorky.mixmin.net> <koo5ho$bdq$1@nnrp.blueworldhosting.com> <koo8mu$35r$1@matrix.darkstorm.co.uk> <koo9jm$cf6$1@nnrp.blueworldhosting.com>Show Full Headers
Complete Article Headers
Message-ID: <kood6j$98p$1@matrix.darkstorm.co.uk> Subject: Re: X-Trace Header Hashing? Date: Wed, 05 Jun 2013 23:14:11 +0100 From: Tony <tony@darkstorm.invalid> References: <koisur$usg$1@nnrp.blueworldhosting.com> <koj52n$i2d$1@matrix.darkstorm.co.uk> <slrnkqrclv.ceu.steve@snorky.mixmin.net> <koo5ho$bdq$1@nnrp.blueworldhosting.com> <koo8mu$35r$1@matrix.darkstorm.co.uk> <koo9jm$cf6$1@nnrp.blueworldhosting.com> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.dca3.giganews.com!border2.nntp.dca3.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!news.bbs-scene.org!news.unit0.net!matrix.darkstorm.co.uk!.POSTED!not-for-mail Newsgroups: news.software.nntp Organization: Organised? Me? Nah! Lines: 68 Reply-To: tony@darkstorm.co.uk NNTP-Posting-Host: 2MhtC4TZt9eOTJuS6JTz0L6ifsf94myEPLymqbaqD2k= Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: matrix.darkstorm.co.uk UQxAmY9vIEOwl68djhAvRCMSY1vkuyO2UnKdOpnaGiE== X-Complaints-To: abuse@matrix.darkstorm.co.uk NNTP-Posting-Date: Wed, 5 Jun 2013 22:13:39 +0000 (UTC) X-User-ID: 57ZC41n64AdrXhgSwnQLra71yFH4SeZus1z16mntJtw= X-Newsreader: Forte Agent 6.00/32.1186 X-Original-Bytes: 3507