Article View: alt.privacy.anon-server
Article #251937Re: Rooster's Method of batch decryption
From: Rooster
Date: Mon, 14 Nov 2011 05:38
Date: Mon, 14 Nov 2011 05:38
181 lines
8187 bytes
8187 bytes
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I can see in the previous posting I made that some of the lines in the batch file appeared to wrap to the next line, and I want to clarify those lines so that there is no confusion or mistakes in the batch file. I believe it that I have now removed the line wrapping in QSL to avoid this issue, and I am therefore re-posting the batch file here. There also appears to have been one line where one of the characters actually got dropped out during my copy- and pasting procedure, and I have corrected that here. Aside from that everything else looked good. I will look at how this one posts and let you know if anything appears differently than how I have intended, but I expect it should be fine now. I will let you know in either case. **Please copy and past this one for your use** Thanks. - ----------------------- 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 /a 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)? ECHO. 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 - ---------------------------------------- -----BEGIN PGP SIGNATURE----- Version: N/A iQGcBAEBAgAGBQJOwKC9AAoJEO3Co03SMUtBMlMMAJ8IJGY0Eu+lQ1rekDBPbE2W LUfP89GHVn+Q37fpY3YwWreFy7lcmgdRm33pN+S6i5OZJLYzBwfXxVQruTrkwD9C d0acWCuGZa24rpHVmUo82H4XM0UM/4RTFRU1T+NjmcS4cwKKHtDriQu0hh5yOqYc Yz8ptRVPlvdRWAhk8TMm7c//s545y2NE0S1UqD3Of2L9L4Km5PQrg7Wf9tMHhGV9 hluOqnhc7aM6NpkSdorWxTbQnFq7f++7DstU3uriJ2q8k5efw9qm91u8i1twEoJB RLpKNPCVX02UbKYWRbm3P2uCdv3dRb8pJnoYEV5TdGscHyfzetqsLLNklQyKbvfW 75OODipIrFeb4MiYh/r9Kb5yA9lsJKWUAhk5TT/dAP1vJ+K0is4v/eWrm4ftOMrB nKyUZUlh24zt4KoZEDVZSjsGoM9nhz1vep/aGFDMqikO/XTNnL3Grbm/VpnvyHxM g2wZIx0TrXT1GpIdUNZYbYPIeA2hlJlvRLTzDab7dA== =lozm -----END PGP SIGNATURE----- -- rooster@thechickencoop.net
Technical Details
Message-ID:
<5MI8N2TO40861.5683796296@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!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!eweka.nl!hq-usenetpeers.eweka.nl!188.40.76.149.MISMATCH!mail2news.mixmin.net!not-for-mailReferences:
<PH9ADIIW40846.5791666667@reece.net.au> <9fbcab964528188aea386a9455bd825f@dizum.com> <FHOZFQZU40855.7041087963@reece.net.au> <JUHDBNIM40861.4019444444@reece.net.au>Show Full Headers
Complete Article Headers
Message-ID: <5MI8N2TO40861.5683796296@reece.net.au> Subject: Re: Rooster's Method of batch decryption Date: Mon, 14 Nov 2011 05:38:28 +0000 From: Rooster <remailer@reece.net.au> References: <PH9ADIIW40846.5791666667@reece.net.au> <9fbcab964528188aea386a9455bd825f@dizum.com> <FHOZFQZU40855.7041087963@reece.net.au> <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!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!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: 182 Injection-Info: mail2news.mixmin.net; mail-complaints-to=abuse@mixmin.net