Article 133010 of comp.os.vms:
Path: nntpd.lkg.dec.com!crl.dec.com!crl.dec.com!caen!kuhub.cc.ukans.edu!zippy.dct.ac.uk!river.tay.ac.uk!insc3mm
Newsgroups: comp.os.vms
Subject: Re: Rot13 for VMS?
Message-ID: <1995Nov1.120007@river.tay.ac.uk>
From: insc3mm@river.tay.ac.uk (Malcolm MacArthur)
Date: 1 Nov 95 12:00:07 GMT
References: <1995Oct30.225219.1648@grove.iup.edu>
Organization: University of Abertay Dundee
Nntp-Posting-Host: river.tay.ac.uk
Lines: 52

In article <1995Oct30.225219.1648@grove.iup.edu>, pyld@grove.iup.edu (Matthew Schnierle) writes:
> -----BEGIN PGP SIGNED MESSAGE-----
> 
> Is there an application/utility for VMS that will Rot13 encode a text file?
> NEWSRDR (Madgoat) will decode Rot13, but I've been unable to find a way to
> encode files.  Thanks.
I did this as a programming exercise, partly based on a 2-line rot13 filter I 
saw once. It could be smaller at the expense of functionality and ease.
As it's only abt. 30 lines, here it is.
-- cut --
#include <stdio.h>
/* rot13 - rot13 "encrypt" a file. Also decrypts (by nature of algorithm... */
/* Malcolm MacArthur   April 1994 */
char rot13_char (char c)
{
return ( ((c>='a') && (c <'n')) || ((c>='A') && (c<'N')) )? c+13 :
   ( (((c>'m') && (c <= 'z')) || ((c> 'M') && (c<='Z')))?c-13 : c) ;
}
main(int argc, char *argv[] ) 
{
char c;
char *outfile;
FILE *ifp, *ofp;

if (argc <2 || argc > 3) {
   fprintf(stderr,"Usage: %s infile [outfile]",argv[0]);
   exit(0);
   }

if (argc == 2) { 
   ofp = stdout;
   } else {
   ofp= fopen(argv[2],"w");
   }
ifp = fopen(argv[1],"r");
while ((c=getc(ifp)) != EOF) {
	putc(rot13_char(c),ofp);
        }
exit (0);
}
-- cut --
> _______________________________________________________________________________
> Matt Schnierle     pyld@oak.grove.iup.edu     http://www.ma.iup.edu/~pyld/
> WWW or keyserver for PGP key.  These views are mine, not IUP's (I hope)
> "When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl!"
> --Brad Templeton
-- 
--
Malcolm MacArthur              insc3mm@river.tay.ac.uk
A drunken layabout attempting to be VP Communications.
Mediocre homepage:     http://www.dct.ac.uk/~mcscs2mm/
(for a while longer)        *SA homepage on the way..*


