Article View: alt.privacy.anon-server
Article #254804Re: esubbf capability on mixmin.net type I remailer
From: StealthMonger
Date: Sat, 03 Mar 2012 20:26
Date: Sat, 03 Mar 2012 20:26
266 lines
10201 bytes
10201 bytes
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Anonymous <nobody@mixmin.net> writes:
> I verified the resulting esub using blowfish decryption key "Esubbf Key";
> the output matches the hash of "Subject Text".
> Even if there is no documentation for it, you can always use the Source.
> [...]
> I can't find the source for the blowfish version.
Appended below, together with a rendering of the man page.
- --
-- StealthMonger <StealthMonger@nym.mixmin.net>
Long, random latency is part of the price of Internet anonymity.
anonget: Is this anonymous browsing, or what?
http://groups.google.ws/group/alt.privacy.anon-server/msg/073f34abb668df33?dmode=source&output=gplain
stealthmail: Hide whether you're doing email, or when, or with whom.
mailto:stealthsuite@nym.mixmin.net?subject=send%20index.html
Key: mailto:stealthsuite@nym.mixmin.net?subject=send%20stealthmonger-key
==> esubbf-1.03/esubbf.c <==
#if 0/*
exec gcc -g -o `basename $0 .c` $0 -lcrypto -lc;*/
#endif
/* Note: Because of the foregoing, an executable can be built
simply by issuing the command ``sh esubbf.c'' to the shell.
SYNOPSIS
esubbf <key> <subject>
DESCRIPTION
Write to stdout the 48 digit hexadecimal code of a number
derived according to the esubbf algorithm from the given <key>
and <subject>. Functions like mixmaster.ren1.c.t1_esub except
that it uses Blowfish instead of IDEA, avoiding patent issues.
The fields of the number can be pictured as follows:
______________________________________________
| | |
| random iv | encrypt(subject,key,iv) |
| 64 bits | 128 bits |
|_______________|_____________________________|
where "subject" and "key" refer to the 128-bit MD5 hashes of
the given <key> and <subject>, and encryption is computed by
BF_cfb64_encrypt(3).
SEE ALSO
esubbft
*/
#include <stdio.h>
#include <stdlib.h>
#include <openssl/md5.h>
#include <openssl/blowfish.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
void print8(unsigned char id[])
{
printf
("%02x%02x%02x%02x%02x%02x%02x%02x",
id[0], id[1], id[2], id[3], id[4], id[5], id[6], id[7]);
}
int main(int argc, char **argv)
{
BF_KEY ks;
int n=0, randfd;
char keyd[16], subd[16], tsvd[16], iv[8];
if ( argc != 3 ) return 1;
MD5(argv[1],strlen(argv[1]),keyd);
BF_set_key(&ks, 16, keyd);
MD5(argv[2],strlen(argv[2]),subd);
#if defined(__linux__)
randfd = open("/dev/urandom", O_RDONLY);
#elif defined (__OpenBSD__)
randfd = open("/dev/srandom", O_RDONLY);
#else
/* FIXME */
equivalent_for_your_architecture;
#endif
read(randfd, iv, 8);
print8(iv);
BF_cfb64_encrypt(subd, tsvd, 16, &ks, iv, &n, BF_ENCRYPT);
print8(tsvd);
print8(&tsvd[8]);
return 0;
}
==> esubbf-1.03/esubbft.c <==
#if 0/*
exec gcc -g -o `basename $0 .c` $0 -lcrypto -lc;*/
#endif
/* Note: Because of the foregoing, an executable can be built
simply by issuing the command ``sh esubbft.c'' to the shell.
SYNOPSIS
esubbft <key> <subject> <test>
DESCRIPTION
Return 0 if <test> might have been the result of running
"esubbf <key> <subject>", else 1. A succinct statement of the
functionality is that
esubbft <key> <subject> $(esubbf <key> <subject>) ; echo $?
gives 0.
SEE ALSO
esubbf
*/
#include <stdio.h>
#include <stdlib.h>
#include <openssl/md5.h>
#include <openssl/blowfish.h>
int scanbytes(const char* buf, unsigned char* bytes, const int count)
{
int i;
char s[]="0xxx" , *eptr;
for (i = 0; i < count; i++) {
s[2] = *(buf + 2*i) ;
s[3] = *(buf + 2*i + 1) ;
eptr = &s[0];
*(bytes + i) = (unsigned char) strtol(s, &eptr, 16);
if ( eptr == &s[0] ) return 1;
};
return 0;
}
int main(int argc, char **argv)
{
BF_KEY ks;
int n=0;
char keyd[16], subd[16], tsu[24], tsvd[16];
if ( argc != 4 || strlen(argv[3]) != 48 ) return 1;
if ( scanbytes(argv[3],tsu,24)) return 1;
MD5(argv[1],strlen(argv[1]),keyd);
BF_set_key(&ks, 16, keyd);
BF_cfb64_encrypt(&tsu[8], tsvd, 16, &ks, tsu, &n, BF_DECRYPT);
MD5(argv[2],strlen(argv[2]),subd);
return (memcmp(subd, tsvd, 16) == 0 ? 0 : 1);
}
==> esubbf-1.03/esubbft-arthdr <==
#!/bin/sh
# SYNOPSIS
# esubbft-arthdr key sub
# DESCRIPTION
# Returns the result of calling esubbft key sub test, where
# test is a ^Subject: field found on standard input. Useful
# as a procmail test when fed the header of a candidate
# article.
esubbft $1 $2 $(sed -n 's/^Subject: //Ip')
==> esubbf-1.03/esubbf.1 <==
ESUBBF(1) ESUBBF(1)
NAME
esubbf, esubbft, esubbft-arthdr - compute or test an encrypted subject
SYNOPSIS
esubbf key subject
esubbft key subject esub
esubbft-arthdr key subject
DESCRIPTION
Compute or test a so-called "encrypted subject" for use in a news arti-
cle posted on USENET newsgroup alt.anonymous.messages. This is random-
looking 48-digit hexadecimal number which is supposed to be efficiently
recognizable, but only with knowledge of the subject and key.
These programs are intended for use in shell scripts and would rarely
be used interactively from the keyboard.
For all three programs, subject and key are the subject to encrypt and
the key with which to encrypt it.
esubbf computes and writes to stdout an encrypted subject using the
given subject and key plus a crytographically-strong random number.
esubbft tests the given encrypted subject esub and returns success code
0 if esub could have resulted from the given subject and key, else it
returns failure code 1.
esubbft-arthdr is a simple script which applies esubbft to the content
of the first Subject: line found on stdin. It is useful as a test in a
procmail(1) script.
The algorithm for computing an encrypted subject is identical with that
of the "classic" esub (see HISTORY below) except that it uses Blowfish
encryption instead of IDEA (which is patented). The 48-digit encrypted
subject encodes a 64-bit random IV followed by the 128-bit result of
encrypt(subject,key,IV). The intention is that it not be feasible to
determine subject or key from esub, or to determine if two esubs could
have resulted from the same subject and key.
HISTORY
"Encrypt Subject" was discussed by Andy Dustman in 1997 on the remailer
operators mailing list. He wrote that "it allows you to encrypt a hash
of the subject using a secret key, thus making the subject appear to be
a random-looking string of 48 hex digits which is different each time
(due to IDEA-CFB encryption). It's intended for nym reply blocks which
point to alt.anonymous.messages." By 1999 it had been incorporated by
RProcess into the widely-used Reliable remailer. See
http://www.skuz.net/potatoware/esubplug.html. An error in an early
implementation was worked out on the remailer operators mailing list in
dialogue between RProcess and Ulf in 1999. A noteworthy remark by Ulf
at this time was "The idea of esub is that each message has a different
Subject header and only the person with the key can check which ones
belong together."
Working from these sources, the present author ported the algorithm
back to its original Unix platform in 2003 for use in pseudonym reply
blocks to alt.anonymous.messages. The recent introduction of stealth-
mail(7), a new application having no need to be interoperable, was a
fine opportunity to break with the original patented IDEA implementa-
tion. blowfish(3) was chosen as the replacement because of the avail-
ability of BF_cfb64_encrypt(3), which is the mode of the original IDEA
implementation.
SEE ALSO
blowfish(3), procmail(1).
AUTHOR
StealthMonger <StealthMonger@nym.alias.net>
2005 June 14 ESUBBF(1)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.9 <http://mailcrypt.sourceforge.net/>
iEYEARECAAYFAk9SVN8ACgkQDkU5rhlDCl5mHQCeLA9xjTlvI+PqpNbinQQCyymw
/WIAn0P73fhjQOwYsXpVwmJ3aa1nZz5Z
=DiRy
-----END PGP SIGNATURE-----
Technical Details
Message-ID:
<20120303202659.4DB78EABBB@snorky.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!num2.nntp.dca.giganews.com!num1.nntp.dca.giganews.com!number.nntp.dca.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!goblin1!goblin.stu.neva.ru!news.mixmin.net!mail2news.mixmin.net!not-for-mailReferences:
<e41c452c1f051036ed16b0a4b9497a29@anon.mixmaster.mixmin.net> <slrnjksdvg.t1h.admin@news.mixmin.net> <d79ea116d28dbaa4ea588e81d6204149@anon.mixmaster.mixmin.net> <slrnjkvngq.t1h.admin@news.mixmin.net> <c3575bbb43a26d2144a7345601632870@anon.mixmaster.mixmin.net> <5UEZPN5140971.0606712963@reece.net.au> <5f252d5ee30223c14bfcc4f0fa7a7a59@anon.mixmaster.mixmin.net>Show Full Headers
Complete Article Headers
Message-ID: <20120303202659.4DB78EABBB@snorky.mixmin.net> Subject: Re: esubbf capability on mixmin.net type I remailer Date: Sat, 03 Mar 2012 20:26:59 +0000 From: StealthMonger <Use-Author-Supplied-Address-Header@[127.1]> References: <e41c452c1f051036ed16b0a4b9497a29@anon.mixmaster.mixmin.net> <slrnjksdvg.t1h.admin@news.mixmin.net> <d79ea116d28dbaa4ea588e81d6204149@anon.mixmaster.mixmin.net> <slrnjkvngq.t1h.admin@news.mixmin.net> <c3575bbb43a26d2144a7345601632870@anon.mixmaster.mixmin.net> <5UEZPN5140971.0606712963@reece.net.au> <5f252d5ee30223c14bfcc4f0fa7a7a59@anon.mixmaster.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!num2.nntp.dca.giganews.com!num1.nntp.dca.giganews.com!number.nntp.dca.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!goblin1!goblin.stu.neva.ru!news.mixmin.net!mail2news.mixmin.net!not-for-mail Newsgroups: alt.privacy.anon-server Author-Supplied-Address: StealthMonger<AT>nym<DOT>mixmin<DOT>net Lines: 267 Injection-Info: mail2news.mixmin.net; mail-complaints-to=abuse@mixmin.net