🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Rooster's Method of batch decryption

#251936
From: Rooster
Date: Mon, 14 Nov 2011 01:38
328 lines
15925 bytes
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

In article <FHOZFQZU40855.7041087963@reece.net.au>
Rooster <remailer@reece.net.au> wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> [snip]
>
> > > Actually it moves fairly quickly, just depending on how
> > > many messages you have and how many passwords are in your list.
> >
> > [snip]
> >
> >
> > I believe I will be able to come up with some other refinements of my batch
> > decryption method, and I will share them here.  It's always nice to have
> > alternatives.  Thanks.


As I stated in my last posting, I want to continue to enchance the functionality
and usefulness of the batch program I created for finding and deciphering
messages in 'a.a.m.'.  I am pleased to say that I have suceeded in doing so
again, substantially.  At that time I provided a means for simplifying the
process of decryption of messages by making it possible for users to apply the
automatic batch process to all the messages downloaded from 'a.a.m.' without
their first having to dispatch a secondary program to figure out which messages,
if any, belonged to them, based on the messages' esub or hsub encryption.

In addition, I also provided a basic enhancement of this all-or-nothing approach
of attempting decryption on all of the downloaded messages as one group, by
enabling users to separate symmetrically encrypted messages from those with
asymmetric encryption so that the process could be applied only to symmetrically
encrypted messages, if the user chose to do so.  By separating and eliminating
the asymmetic messages, users are able to avoid the longer and redundant time
required for attempting decryption on asymmetically encrypted messages, which
generally take longer because they are encoded with hidden-recipients and
because the users may have several secret keys for the procedure to try, one
after another.  Using an easy method to eliminate roughly half of all the
messages and to apply decryption rapidly on a smaller group of symmetric
messages, while dispensing with the irrelevant ones, is a huge time-saver.

Now I have extended my method further by building in to the automatic batch
process a routine that allows users to select whether to apply decryption not
only on the group of messages with symmetric encryption on their outer layers,
but also whether to select the group of messages with asymmetric encryption if
need be.  Therefore, if you have messages that use either one or the other of
these two kinds of encryption; or, rather, if you have messages with both kinds
of encryption on them, my method will help you equally well and in the same
manner as it helps others.  Users will now be able to choose easily to apply
decryption processes specifically on the group of messages with the same sort of
encryption as they expect their messages to have.  Of course, the option is
still available, as it was initially, to apply the decrytion process on the
entire group of both kinds; and in any case the user will not have to spend time
and effort configuring other programs or scripts related to esub and hsub issues.

I would expect that this efficient and simpler method of finding and decrypting
messages could be especially helpful to newer users who have not yet learned the
complexities of configuring esub and hsub issues and who want to create nyms and
retrieve messages with minimal fuss.  The savings in time by choosing only one
group can help substantially.  My new method allows you to do just that.

Furthermore, I have revised and improved upon the earlier routines to increase
their efficiency and to accomodate these separate choices of which groups to
attempt deciphering, while maintaining the primary goal of simplicity and ease.
Once you have answered one or two questions, the process begins and completes
without further prompting.

As before, I have indicated clearly within the batch program itself, which part
of the processing is related to which group of messages and which part pertains
entirely to the core functionality.  I do not believe it is difficult to
understand, but I am certainly willing to answer any questions that you may have
about it. While running the batch program, you will be presented with a couple
of questions to answer at the beginning in regard to which type of encrypted
message you want to decipher. Your answers will instruct the program to apply
the appropriate procedure.  It then finishes up by deleting any of the temporary
files which may have been used, such as a password file, and it removes the
variables from memory.  If you had any messages available, they will be
decrypted accordingly.

Here is the new batch program, which I fondly refer to as Rooster's Method:


- --------------------------
SETLOCAL
CLS
@ECHO off
ECHO : The folder where you execute this batch file
ECHO : should have ONLY this batch file, the
ECHO : password-file, and the messages for decrypting.
ECHO.
@ECHO Beginning Rooster's Method for batch decryption:
@ECHO.
REN *.txt *.asc
IF NOT errorlevel 0 GOTO EOF

rem Begin OPTIONAL BLOCK--

rem: This block routine removes spaces from erratic filenames
SET "filename="
FOR %%F in (*.asc) do SET filename=%%F & CALL:sub1 %%F
GOTO :jump

:sub1
SET filename=%filename: =%
RENAME "%*" %filename%
GOTO :eof
:jump
rem: end routine to remove spaces from filenames

SET counter=0
:startnow
IF %counter%==2 GOTO core
SET /a counter+=1
IF %counter%==2 ECHO    This block allows the user to choose whether to attempt
deciphering
IF %counter%==2 ECHO    on both symmetric and asymmetric encrypted messages, or
to attempt
IF %counter%==2 ECHO    on only one of these two types of encrytion. Unless you
choose either
IF %counter%==2 ECHO    "Y" or "N", both types of message will be attempted.
IF %counter%==2 ECHO    You get one more try to answer correctly.
SET "choice="
ECHO.
ECHO    Do you want to search both types of message?
ECHO    You must type Y or N and hit enter.
SET /p choice=   Please make your choice now:  ^(Y or ^N)?
@ECHO.
IF NOT DEFINED choice GOTO startnow
IF /i %choice%==Y GOTO core
IF /i NOT %choice%==N GOTO startnow

rem: This block routine allows you to remove all
rem: messages not having outer symmetric encryption
CLS
SET counter=0
:option1
IF %counter%==2 GOTO EOF
IF %counter%==1 (ECHO    You will get only 2 tries to answer correctly.)
IF %counter%==1 (ECHO    Unless you choose "Y" or "N", batch processing will
cease.)
SET /a counter+=1
SET "decision="
ECHO.
ECHO    You have chosen "not" to do both types of message.
ECHO    Do you want to search only files with an outer layer
ECHO    of symmetric encryption^? If you know that all of your
ECHO    messages have an outer layer of symmetric encryption,
ECHO    then you should select "yes." If you do select "yes,"
ECHO    then all files having only asymmetric encryption
ECHO    will be deleted first, before decryption begins.
ECHO    This can save a lot of time.
ECHO    You must type Y or N and hit enter.
ECHO.
ECHO    This is try # %counter%.
ECHO.
SET /p decision=  Please make your decision now:  ^(Y or ^N)?
ECHO.
IF NOT DEFINED decision GOTO option1
IF /i %decision%==N GOTO option2
IF /i NOT %decision%==Y GOTO option1
FOR %%G in (*.asc) do gpg --list-only --status-fd 1 %%G | find /i "enc_to" &&
del %%G
ECHO.
ECHO    Deleting messages not having an outer layer of symmetric encryption...
GOTO core
rem: end routine for removing messages without outer symmetric encryption

rem: this block routine allows you to remove all
rem: messages with outer layer of symmetric encryption
CLS
:option2
SET "decision2="
ECHO.
ECHO    You have chosen to attempt deciphering of messages
ECHO    with no outer layer of symmetric encryption. Only
ECHO    those with asymmetric (public key) encryption will be
ECHO    searched. This means that for any of the messages with
ECHO    hidden-recipients, all of the secret keys on your key-
ECHO    ring will be tried until a match is made, if any.
ECHO.
ECHO    If you want to search only these messages, you should
ECHO    answer "yes" below.  If you prefer to abort the decryption
ECHO    process, you should answer "no" below. If you do answer
ECHO    "no", the messages will "not" be deleted and the batch
ECHO    processing will end.
ECHO.
SET counter=0
:lasttry
IF %counter%==2 (ECHO    You have not chosen to search any messages) & GOTO EOF
SET counter+=1
ECHO.
ECHO	   Do you want to search only messages with asmmetric encryption?
SET /p decision2=   Please make your decision now:  ^(Y or ^N)?
IF NOT DEFINED decision2 (ECHO   You have answered incorrectly.) & GOTO lasttry
IF /i %decision2%==N GOTO EOF
IF /i NOT %decision2%==Y (ECHO   You have answered incorrectly.) & GOTO EOF
FOR %%K in (*.asc) do gpg --list-only --status-fd 1 %%K | FIND /i "enc_to" && DIR /b %%K>>filelist
IF NOT EXIST filelist (ECHO There are no messages that indicate having
asymmetric encryption on its outer layer!) & GOTO endprocess
ECHO.
ECHO    Removing messages with symmetric encryption...
FOR %%A in (*.asc) do @FINDSTR /c:%%A filelist || ERASE /f /q %%A

rem End OPTIONAL BLOCK--

:core
SET "pword="
:variable
SET /p pword=<password-file
rem: IMPORTANT NOTE: If your password contains any of these command characters
rem: (between the quotation marks) "& < > |", which take precedence over ECHO,
rem: then you should precede the character with this symbol "^" in your password-
file.
IF NOT DEFINED pword GOTO endprocess ELSE GOTO decipher
:decipher
ECHO    Beginning the decryption process....
FOR %%G in (*.asc) do ECHO %pword%|gpg --batch --passphrase-fd 0 --decrypt-files
%%G
FOR /F "skip=1" %%A in (password-file) do @ECHO %%A>>password-file2
IF NOT EXIST password-file2 GOTO endprocess
ATTRIB -R password-file
MOVE /y password-file2 password-file
GOTO variable

:endprocess
IF EXIST filelist ERASE /f filelist
TYPE nul>password-file
ERASE /f password-file
ECHO There are no more passwords in the password-file.
SET "pword="
ECHO Your messages, if any, have been deciphered.
ECHO Removing undeciphered messages...
ERASE /f *.asc
:EOF
ECHO The batch has finished processing.
ENDLOCAL
- -----------------------------

I have tested it and found no problems.  I do not expect you will have any
either. I have included some notes inside the batch file, which may prove
helpful.
If your passwords contain unusual characters, which you may need to allow for
with
gpg on a regular basis anyway, then you certainly should read the comments I made
about them in the "core" block of the batch file above.

In a nutshell, let me offer these simple instructions again in case you have not
read over the notes already from my previous postings.

1.	download all the messages you want to search from 'a.a.m.';
2.	put (export) these messages unaltered into a local folder
	on your system, outside of the newsreader program itself;
3.	make sure that the messages are in text format with '.txt'
	suffixes and that each message is a separate file;
4.	put your corresponding list of passwords into a plain-text file,
	named simply "password-file" (without the quotes), but without
	any suffix, and add it to the same folder with the messages;
5.	put this batch file into the same folder, named whatever you
	like--something like "rooster-batch.bat". :)
6.	nothing else should be in the folder! now run the batch file.

Let me also reiterate an important point about security.  You will notice in
the batch file that I have used the Windows command ERASE.  if you really
want to delete a file securely, this is not the way to do it; but you
can download another little program from microsoft to do so.  Secure erasure
can be achieved easily by using the SDELETE command. It is simple,
small and effective, and it can be downloaded here:
http://technet.microsoft.com/en-us/sysinternals/bb897443.
I would use it, for example, with these options:

"sdelete -a -p 5 password-file"

If you have sdelete and prefer to use it, as I would recommend, you can modify
the batch file by simply replacing the two lines that have "ERASE /f filename",
for example, with this: "SDELETE -a -p 5 filename".


Why do i believe that this method has merit?  It is much easier to use
than trying to configure esub and hsub.  It is an understatement to say
that undue production has been wasted on trying to find one's messages
based on locating and deciphering the esub and hsub subject headers.
Much too much.

Newer users especially will appreciate the ease of use it offers.  Before
they have the time, patience and sophistication needed to configure a
secondary program to find their messages in the group, they can use my
method to process all the message promptly and without all the fuss,
automatically.  Therefore, new users can get acquainted with anonymity
issues more easily and more quickly, and they can get their nyms set up.
It can help them get up to speed and gain confidence.

It promotes the habit of downloading all the messages. it runs with a
minimal footprint.  it deletes any files it no longer needs and any
environment variables it has created when it finishes. It is not
sloppy or wasteful. It does not need any other program to accomplish
its objective besides Gnupg and Windows' native command shell.

I could list others, but i think this is sufficient reasons.  Even so,
I can also say that it has merit in that it has been a beneficial,
interesting and fun project. I have learned some stuff, and i have
contributed to a group whose goals i think are worthwhile and very
important. I offer it as an alternative, not because i think it is
superior to other alternatives.  that is something each of us can
answer only for himself.  thanks.

-----BEGIN PGP SIGNATURE-----
Version: N/A

iQGcBAEBAgAGBQJOwGh2AAoJEO3Co03SMUtBAjUL/3OjLN8s1uHHt52kU0bvchMi
K2EhjdezJxpDqtDbzKPsGblEPM0bArc6lMnXbH2WWBiE/2CwO8PJmYqfqxw7IiVM
3gZHudTOKPD3U1nJSoVuuSCz6T/GTkaY6pUIQFyd+BW8J8cbvM7GkrlGtd/XHurO
FkN8SaO07IS6g9+v2yt4Zp8m/GCtlZCPRGFtYAck3d1tT6NXEGn9FsYJepYMAH2A
Fj4jm1OaNzIuD4aVZjlfbVbzdqLoELtMlGpo+5WB/U52yxYir5yoiU3sph7muBh5
yhdKv+h/pSezUdLlDcZ1KITKddEl1y3KTY7sOf4UqJRPGjLCC+H/fdtm7C/cRBVc
HdKa1avR0sKEzO+l5CBaLy92K1SPiEKR7vH3sPg1Ya3u/tPclgjBkTIDSzCW235k
lLmGG2Rn9+oo5+EUPQ/KQqxMQqalRLLktsOmB6LhXRRmH90RaosBX/ebfUFrqzur
kgDN31yvn0DTG91eqmSZPwvPaYQkJEimRNCw3u5epg==
=Pamz
-----END PGP SIGNATURE-----

-- 
rooster@thechickencoop.net


Technical Details
Message-ID: <JUHDBNIM40861.4019444444@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!goblin3!goblin.stu.neva.ru!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!tudelft.nl!txtfeed1.tudelft.nl!feed.xsnews.nl!border-2.ams.xsnews.nl!feeder3.cambriumusenet.nl!feed.tweaknews.nl!193.201.147.87.MISMATCH!news.astraweb.com!border2.a.newsrouter.astraweb.com!border1.hitnews.com!eweka.nl!hq-usenetpeers.eweka.nl!188.40.76.149.MISMATCH!mail2news.mixmin.net!not-for-mail
References: <PH9ADIIW40846.5791666667@reece.net.au> <9fbcab964528188aea386a9455bd825f@dizum.com> <FHOZFQZU40855.7041087963@reece.net.au>

Show Full Headers
Complete Article Headers
Message-ID: <JUHDBNIM40861.4019444444@reece.net.au>
Subject: Re: Rooster's Method of batch decryption
Date: Mon, 14 Nov 2011 01:38:48 +0000
From: Rooster <remailer@reece.net.au>
References: <PH9ADIIW40846.5791666667@reece.net.au> <9fbcab964528188aea386a9455bd825f@dizum.com> <FHOZFQZU40855.7041087963@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!goblin3!goblin.stu.neva.ru!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!tudelft.nl!txtfeed1.tudelft.nl!feed.xsnews.nl!border-2.ams.xsnews.nl!feeder3.cambriumusenet.nl!feed.tweaknews.nl!193.201.147.87.MISMATCH!news.astraweb.com!border2.a.newsrouter.astraweb.com!border1.hitnews.com!eweka.nl!hq-usenetpeers.eweka.nl!188.40.76.149.MISMATCH!mail2news.mixmin.net!not-for-mail
X-No-Archive: yes
X-Remailer-Contact: abuse@reece.net.au (English Only Please)
Newsgroups: alt.privacy.anon-server
Lines: 329
Injection-Info: mail2news.mixmin.net; mail-complaints-to=abuse@mixmin.net
X-Original-Bytes: 15697