Leave My Stuff Alone

See all articles from T-S Horizons n18
Author(s): William J. Pedersen
Publication: T-S Horizons
Pub Details: T-S Horizons n18 (Issue 18)
Date: April 1986
Pages: 8-9

In all of us there is a deep desire to keep our property safe from observation, damage, theft, and plagiarism. It is human (and corporate) nature. As disturbing as it might be, our fondest hopes are doomed to failure!

Students of cryptography are well aware that few approaches meet the needs for secrecy. All codes can be broken in time. That is quite all right if it takes longer than you need to keep the secret.

Computer programs are code. Anything you write is therefore a form of cryptography. How about that?

Let’s take a case in point. Issue #14 of TS Horizons had on Scott’s cluttered desk the ubiquitous:

10 ON ERR CONTINUE

Is it breakable? No sweat.

Under the conditions assumed it works very well, but suppose we change the conditions? Don’t load it as a program. Load it as machine code instead.

HOW? You might groan. Well, take it from someone who made a lot of mistakes, including erasing parts of tape records — make a new header. It should specify that machine code is expected, where to load it, and how much. Put it ahead of the old header. When loading, skip the portion of tape for the old header and continue. You will get a tape error message, but the data has most assuredly been loaded. Now you can look at it, change it, and even print it using appropriate utilities.

Why not read the header? It is “protected”. I will not bore you with the how and why of this, nor the way around it. You can say bye-bye to concealment from observation. Unless you can hide the computer from itself, nothing can be hidden. It wouldn’t be a computer any more, would it?

For those of you who have damaged your precious and only tape records, there is some hope.

If you have been paying attention, you have learned that you can write tape headers separately. All you need to do is stop the recorder at the one second gap between header and data record.

So far so good. . .but what kind of header do we write? Assuming that if you’re still with me, you have the smarts to figure out the others — here is an immediate instruction set which will almost always work for programs.

NEW                          (Clears program and variables up to RAMTOP)
DIM A$(30000) (Pushes E_LINE up to 56718)
POKE 26710,0:POKE 26711,1: (LINE #1)
POKE 26712,48:POKE 26713,50: (LENGTH - 4)
POKE 26714,234: (REM)
POKE 56715,13 (RETURN)
POKE 56716,128 (END OF BASIC FLAG)
POKE 23627,141:POKE 23628,221(RESET VARS TO 56717)

EGAD! This is the world’s longest REM statement! There is no limit to the length of a statement, except it is impossible to EDIT any that create more than 768 characters on the screen.

Remember that control characters don’t show on the screen and tokens generate more than one character. CHR$(234) generates “R”, “E”, “M”, and ” “.

The REM statement has completely replaced A$(30000). VARS now points to an empty variable list.

SAVE "Fixit"

This will write the new header, and a very long REM if you let it. We’ll settle for just the header.

This header expects a program from PROG to VARS-1, and variables from VARS to E_LINE (but there are none). We have extablished these with our long REM statement and by poking VARS.

This header gives an error when it fails to find CHR$(128) at VARS-1, E_LINE-1, a valid CHECKSUM byte, or finds an erased section. Any program smaller than the REM statement will load. This includes programs with damage due to accidental POKE’s which destroy the line structure. These don’t run, but can be mixed using methods similar to the one used here. Immediate commands usually work, even when programs don’t.

Programs with erasure gaps and intact headers already load up to the point of the gap. You can save this much by finding the CHR$(13) at the end of the last intact line, and poking a pair of CHR$(128)’s after it. Then poke VARS to point to the first CHR$(128)and enter CLEAR. (Examine it as machine code. You have already seen how.)

Rescuing the part of the program following an erasure gap can sometimes be done by splicing. A machine code program borrowing routines from the EXROM can read anything. If you had it, you wouldn’t need any other technique.

Now you have diagnostic, and surgical tools for fixing damage.

About plagiarism –. Nobody in their right mind cares to copy GARBAGE. It must have SOME meaning.

If you really want and need security, there is one reliable way. Encrypt your code using a “public key” scheme. This is a method based on a longer integer which is the product of two prime numbers. The “public key” is the long product. The “private key” is either of the primes. The largest binary integer usable with the 2068 is 32 bits. A CRA computer might break a 32 bit code in a few minutes, but why would anyone try?

Theft (or loss if you can’t prove it) hurts just as much when the stolen item is useless to the thief as if it were jewels. Always . . . ALWAYS . . . keep backup copies, stored away from the cleaning lady, the jelly fingers, the compulsive button pushers.

What has been presented here is not intended to let you penetrate deep secrets for criminal purposes. It is for self-help when things get sticky.

What bugs me is that computer manufacturers have advertised and sold security systems that my dog could open. Then they try to prosecute the poor guys who penetrate them. It is hard to see who is the bigger thief.

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.