🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.pascal.misc
Article #153

Re: *******REVERSE ASCII**********

#153
From: KnightBird
Date: Sun, 29 Sep 1996 00:00
49 lines
2735 bytes
On Sat, 28 Sep 1996, Scott Earnest wrote:

> > I know of a college who reversed ASCII values for an encryption
> > program. DOES ANYONE KNOW THE CODE TO DO THIS.
>
> Well, depending on what you mean by "reverse", sure.  But why on earth would you
> want to do that if you want encryption?  It's pathetically easy to break.
>
> program this_is_lousy_encryption;
>
> var
>   fi, fo : file of byte;
>   b : byte;
>
> begin
>   assign (fi,'source.dat');
>   assign (fo,'dest.dat');
>   while not eof(fi) do
>     begin
>       read (fi,b);
>       b := 255-b;
>       write (fo,b);
>     end;
>   close (fi);
>   close (fo);
> end.
>
> (Yes, I'm intentionally demoing this in about the slowest way possible.)

I came up with a more interesting <but still useless> XOR routine.  The
program was simple:  The first few bytes of the encrypted file were ENC,
the next two were the major/minor revision, followed by the source file's
original extention.  The rest of the file was the encrypted source.

The encryption was accomplished by asking for a string.  I was in a hurry,
so I just used Readln..  <owch>  Then, I started, byte for byte, reading
the file and XORing it with the next char of the password string.  When
StrOfs > Length (PW) I would reset the offset to 1.


Simple, alomost totally useless, and a perfect A...  hehehehe  The only
thing I DIDN'T do was put in the password checking CRC...  Wow, that would
have increased security and usability, wouldn't it?  <G>

           \|/           Peace can not exist without war, nor can war
       \\\\/|\////          exist without peace. Think about it...
        \\\\|////             ----------------------------------
            V                 KnightBird - knghtbrd@teleport.com
Technical Details
Message-ID: <Pine.SUN.3.92.960929024626.19941T-100000@linda.teleport.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <1996Sep27.160013.6675@arl.mil> <52jbao$c98@dfw-ixnews4.ix.netcom.com> <324DA8BC.2057@ix.netcom.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11185f,8746d3f6e7cf3444
X-Google-Attributes: gid11185f,public
X-Google-Thread: 10261c,38608a28b5863775
X-Google-Attributes: gid10261c,public
X-Google-Thread: 111659,8746d3f6e7cf3444
X-Google-Attributes: gid111659,public
X-Google-Thread: 102601,8746d3f6e7cf3444
X-Google-Attributes: gid102601,public
From: KnightBird <knghtbrd@teleport.com>
Subject: Re: *******REVERSE ASCII**********
Date: 1996/09/29
Message-ID: <Pine.SUN.3.92.960929024626.19941T-100000@linda.teleport.com>
X-Deja-AN: 186131256
references: <1996Sep27.160013.6675@arl.mil> <52jbao$c98@dfw-ixnews4.ix.netcom.com> <324DA8BC.2057@ix.netcom.com>
content-type: TEXT/PLAIN; charset=US-ASCII
organization: Teleport - Portland's Public Access (503) 220-1016
mime-version: 1.0
reply-to: KnightBird <knghtbrd@teleport.com>
newsgroups: comp.lang.pascal.misc,comp.lang.pascal.borland,ctdl.lang.pascal,osu.pascal