🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

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

#155
From: Rune Moberg
Date: Mon, 30 Sep 1996 00:00
32 lines
1740 bytes
>>I know of a college who reversed ASCII values for an encryption
>>program. DOES ANYONE KNOW THE CODE TO DO THIS.

Hmm... "Reversed ASCII"

That sounds like XOR'ing to me.

If you take a value and XOR it with something else, then you can repeat
the operation and get back the original value.

result := ord(somechar) XOR $FF;  //also a bit toggle

now, if you do:
result := result XOR $FF;
then result will hold the decrypted value of somechar.

XOR is explained in almost every text book, but this
is basically what's going on:
 value XOR value = result
 ------------------------
   0    |    0   =   0
   0    |    1   =   1
   1    |    0   =   1
   1    |    1   =   0

And that's what an eXclusive OR does...

-- 
=\                       homepage @ http://www.qsd.no/staff/rune
 *=- R.Moberg, CD-Player Pro info @ http://home.sn.no/home/mobergru/
=/               my own webserver @ http://pumba.qsd.no
Technical Details
Message-ID: <0ZvTy0JfF2bd089yn@oslonett.no>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <1996Sep27.160013.6675@arl.mil>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10261c,38608a28b5863775
X-Google-Attributes: gid10261c,public
X-Google-Thread: 11185f,8746d3f6e7cf3444
X-Google-Attributes: gid11185f,public
X-Google-Thread: 111659,8746d3f6e7cf3444
X-Google-Attributes: gid111659,public
X-Google-Thread: 102601,8746d3f6e7cf3444
X-Google-Attributes: gid102601,public
From: mobergru@oslonett.no (Rune Moberg)
Subject: Re: *******REVERSE ASCII**********
Date: 1996/09/30
Message-ID: <0ZvTy0JfF2bd089yn@oslonett.no>
X-Deja-AN: 186157070
sender: mobergru@sn.no
references: <1996Sep27.160013.6675@arl.mil>
content-type: text/plain; charset=ISO-8859-1
organization: CD-Player Pro author!
mime-version: 1.0
newsgroups: comp.lang.pascal.misc,comp.lang.pascal.borland,ctdl.lang.pascal,osu.pascal