🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: New Hsub Finder Procedure

#252425
From: Kulin Remailer
Date: Sat, 17 Dec 2011 19:12
305 lines
12692 bytes
In article <20111217170048.3CA7581460@fleegle.mixmin.net>
StealthMonger <Use-Author-Supplied-Address-Header@[127.1]> wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Kulin Remailer <remailer@reece.net.au> writes:
>
> > if i can find a good explanation of how esub is created, i would
> > build one of these scripts for esub as well, if at all possible.
>
> Maybe the comments (or even the code itself) to my blowfish variants
> of the esub software would help?  Appended below.
>
> esub is the same except it uses IDEA instead of blowfish.  I have code
> for that, too, but it would require some sanitizing.


hello, StealthMonger.  i appreciate and am glad that you're chiming in on this.  i 
understand some of what you posted, but i always have difficulty understanding much 
of what you mean, in part because i do not do linux scripting, if that is even the 
right terminology.  i want to figure out how to make an esub so that i can also 
figure out how to find one, but my goal is to do this in Windows, not linux.

i have a few questions for you. did you write all of that script you posted?  does 
what you wrote represent a script written for the bash shell, or what else is it? 
for me Windows makes this notion easier to understand, i believe: there is the 
standard cmd shell and the power shell.  linux, on the other hand, seems to have 
many shells.  as a result, whenever i see a 'script for linux", i am always left 
wondering for which shell this script was made for or runs in. does that make sense?

if you looked at my other post about this, is my understanding correct?  here it is 
again:

----------------------
"i found this information, and i am wondering whether it is still accurate:

"According to the Reliable User's Manual, the "random" strings of
numbers and letters which appear in the "Subject:" line are encrypted
MD5 hashes of the final "Subject:" line.  That is, the remailer client
calculates an MD5 hash from the "Subject:" line(which might be, e.g.,
"ATTN: Dave") in the final or hash headers (below the "##").  This MD5
hash that results from this calculation is likely to be unique to that
particular "Subject:" line.  The remailer client then encrypts the MD5
hash using conventional (symmetric) encryption, specifically IDEA.
The encryption and decryption key is the passphrase given for the
"Encrypt-Subject:" directive."

Accordingly, if i understand this correctly in terms of its explanation of how an
esub is created for the messages in 'a.a.m.', looking at an illustration like this
example:

    Remailer Directives:
    ::
    Test-To: myemail@address.com
    Encrypt-Test: reportphrase
    Anon-To: final1@address.com, final2@address.com,
    final3@address.com
    Encrypt-Subject: mypassphrase

    Hash Headers:
    ##
    Subject: MySubject
    From: My Nickname

I think the esub is made by making an MD5 hash of "MySubject" and using IDEA
symmetric encryption with a password using "mypassphrase".  Does that sound right?
I do not see anything about the length of the final subject, or whether it is
shortened for some purpose."
-------------------------

when i look at your post, it appears to suggest that there is some sort of random 
"number" or data that gets interjected in the process.  to me that is confusing the 
issue because i am also inclined to say that one can figure out the whole thing 
simply enough if he know only the subject and the password.


>
> #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;
> }
>
> #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);
> }
>
> #!/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)                                                            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)
>
> - --
>
>


Technical Details
Message-ID: <Y6ZEU9TX40895.1338310185@reece.net.au>
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.dca3.giganews.com!border2.nntp.dca3.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!novia!news-out.readnews.com!news-xxxfer.readnews.com!85.12.40.131.MISMATCH!xlned.com!feeder3.xlned.com!feeder.erje.net!news.mixmin.net!eweka.nl!hq-usenetpeers.eweka.nl!188.40.76.149.MISMATCH!mail2news.mixmin.net!not-for-mail
References: <GE2BSOK140893.2355092593@reece.net.au> <G99AA5SC40893.6938773148@reece.net.au> <3DJLN2N340894.473599537@reece.net.au> <20111217170048.3CA7581460@fleegle.mixmin.net>

Show Full Headers
Complete Article Headers
Message-ID: <Y6ZEU9TX40895.1338310185@reece.net.au>
Subject: Re: New Hsub Finder Procedure
Date: Sat, 17 Dec 2011 19:12:43 +0000
From: Kulin Remailer <remailer@reece.net.au>
References: <GE2BSOK140893.2355092593@reece.net.au> <G99AA5SC40893.6938773148@reece.net.au> <3DJLN2N340894.473599537@reece.net.au> <20111217170048.3CA7581460@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.dca3.giganews.com!border2.nntp.dca3.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!novia!news-out.readnews.com!news-xxxfer.readnews.com!85.12.40.131.MISMATCH!xlned.com!feeder3.xlned.com!feeder.erje.net!news.mixmin.net!eweka.nl!hq-usenetpeers.eweka.nl!188.40.76.149.MISMATCH!mail2news.mixmin.net!not-for-mail
X-Remailer-Contact: abuse@reece.net.au (English Only Please)
Newsgroups: alt.privacy.anon-server
Lines: 306
Injection-Info: mail2news.mixmin.net; mail-complaints-to=abuse@mixmin.net
X-Original-Bytes: 12421