home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: sci.crypt
- Path: sparky!uunet!munnari.oz.au!sgiblab!darwin.sura.net!spool.mu.edu!yale.edu!ira.uka.de!math.fu-berlin.de!news.netmbx.de!Germany.EU.net!mcsun!sunic!aun.uninett.no!ugle.unit.no!alf.uib.no!hsr.no!frank
- From: frank@hsr.no (Frank A Stevenson)
- Subject: Re: Toggle rot-13 decode..
- Message-ID: <1993Jan27.094456.10542@hsr.no>
- Sender: news@hsr.no
- Organization: Rogaland University Centre
- References: <C1Ho7r.J1M@eis.calstate.edu>
- Date: Wed, 27 Jan 1993 09:44:56 GMT
- Lines: 50
-
- In article <C1Ho7r.J1M@eis.calstate.edu>, ribarbe@eis.calstate.edu (Richard Eldon Barber) writes:
- > This system has an option:
- > %, ^X Toggle rot-13 decoding for this article
- > when viewing a piece of news. Is this encryption? Are there programs
- > available for macintosh or pc's to encode?
- > email ribarbe@eis.calstate.edu
- > ---rick
-
- ROT-13 encryption, is encryption, but it is designed to be secure against
- people not wanting to read the encrypted message. (i.e. NOT secure)
-
- Here is a small c-source that reads from standard input and writes the encrypted
- text to standard out. Note the cipher is symmetrical and the same routine will
- thus encipher and decipher a text
-
- examples of usagege (UNIX)
-
- %rot <infile >outfile
- %
-
- The source should be easy to modify, so it will work under other modes of
- operation.
-
- ----------------------------------------------------
- #include<stdio.h>
-
- main()
- {
- char ch;
- int i;
-
- while(1) {
- ch=getchar();
- if (ch==EOF) return(0);
- if (islower(ch)) {
- i=(int)ch;
- i=i+13;
- if (i>122) i=i-26;
- ch=(char)i;
- }
- if (isupper(ch)) {
- ch=ch+13;
- if (ch>'Z') ch=ch-26;
- }
- putchar(ch);
- }
- }
- ---------------------------------------------------
-
- ><>
-