Posts

Showing posts from September, 2008

Google SyntaxHighligter Widget

If you code, and like to save snippets like I do, you MUST get this .

More PGP Fun

This process outlined is not unlike what I wrote about in my post here , but involves a bit more logic. The script has to check for files that were posted that morning, but also have a file naming convention of the previous day. I've also got about 200 EMR postscript files to sort by date of service. First, the source PGP/tar files must be checked for existence, and must be a pair with the proper date formatted file name. @ECHO OFF SETLOCAL ENABLEDELAYEDEXPANSION :: ////////////////////////////////////////////// :: :: Set path variables for key access, passphrase, :: and source our key files. SET PGPPATH=C:\PGP_keys\ SET PGPPASS=MYPGPPASS :: The "KEY" to a successful import of our keys is running these coMMands as the user :: that will be running this script. :: pgp +batchmode -ka %PGPPATH%SECRING.SKR :: pgp +batchmode -ka %PGPPATH%PUBRING.PKR :: pgp -ke 0xEC671710 <-- after this coMMand, you will be asked to trust the key; this must be done! :: ///////////

Using Batch to decrypt PGP and more

Image
This script was recently written to automatically process files on our FTP server. They come in daily, in pairs, and dated with todays date, e.g. XXERUP0912.dat.pgp. The script checks for existence, ensures a pair is found, makes sure they are the right and same date, then decrypts them and calls an external program I wrote to inject them into a SQL database for querying via ASP, which I also wrote. If any of the steps fail, it gets logged, and an email notification is sent to a number of folks. I had a bit of an issue with expansion, but found the error of my ways in short order... @ECHO On SETLOCAL ENABLEDELAYEDEXPANSION :: ////////////////////////////////////////////// :: :: Set path variables for key access, passphrase, :: and source our key files. SET PGPPATH=C:\PGP_Keys\ SET PGPPASS=MYPGPPASS :: The "KEY" to a successful import of our keys is running these commands as the user :: that will be running this script. :: pgp +batchmode -ka %PGPPATH%SE