ticalc.org
Basics Archives Community Services Programming
Hardware Help About Search Your Account
   Home :: Community :: Articles :: Calc Crypto and the GPC
Calc Crypto and the GPC

Posted on 3 September 1998

The following text was written by S.T.L.:

Well, it's late at night (yet again) and I'm in the mood for a good rant. Well, this article explores one particular idea, but it's also about a general issue. And somehow, I get to another particular idea after the middle. Ah well. I initally had a long 2-line name, but I suppose "Calc Crypto" is acceptable for "Calculator Encryption".

Quite a while ago, I started to become fascinated with Number Theory (primes and such) and I had a TI-85. Obviously in class, when I had all my work done, I fiddled around with it. I made primality proving programs and all sorts of stuff. But the TI-85 was pretty limited because much of Number Theory involves really huge numbers.

Anyways, that meant that if I *wanted* to do anything remotely nifty, I had to whittle it down into a smaller version so my TI-85 could run the thing. Thus, after reading one of my books, I had an idea. It basically goes back to something that a lot of my classmates do, but I hardly ever: passing notes.

Now, I'm not one to advocate passing notes. But, I know enough to know some features of them:

  • A passed note has to be done in relative secrecy. After all, the teacher certainly can't know what's in the note, eh?
  • A passed note has to be done quickly. This is more of a side-effect of writing them on paper, because if it is passed slowly, then anyone can open it up and read it. You *could* give it to Al, "Hey Al, give this to Bob in your next class, cause I don't have him in any of my classes" but then you have to trust Al.
  • A passed note doesn't contain that much information, but it can contain a fair amount, up to a written pages' worth.

This got me thinking. What if industrial-strength encryption was provided on TI calculators? Now, I'm not talking about cheesy, "I dreamed this up last night" encryption, because every programmer seems to fancy himself a cryptographer. I'm talking about an encryption algorithm that is used in commercial software, and has no easy way to break it. (Yes, it's related to Number Theory.) This could solve problems of classroom communication. (And yes, it could be used elsewhere.) But first, an interlude.

Words used here:

  • Encryption: Scrambling a message so no one can read it, without a Secret Key.
  • Decryption: Descrambling said message with the Secret Key.
  • Public Key Encryption: Most encryption involves two people sharing one secret key. The stuff I'm thinking of allows one person to give everyone their Public Key, which allows messages to be SENT to them, but only their Secret Key would let them read it.
  • Compression: Making a message take up less space.

And we're back.... Now, what would public-key encryption do for note passing? First of all:

  • Forget secrecy. You can scrawl the note on the blackboard, and the teacher won't be able to read it, without intercepting your TI. (Solution: decrypt the message in another class, or get a locking program.)
  • Forget timeliness. You can (w/o scrawling the note on the blackboard) write it down on a sheet of paper, and get your classmates to give it to someone - but you could let them do it next class. Then you don't have to trust them not to read it.

Of course, all these things would be hard unless the program could compress messages. With the ideas I currently have, public keys would be a string of 64 characters, and messages 64 or 128. This is because I know a way for extremely simple Special Purpose Compression, it would really only work for the Calculator Encryption project.

And, importantly, all someone would have to do is give out their Public Key to everyone who has the encryption program. Their Secret Key remains on their calculator, their Public Key goes everywhere. (Public encrypts messages, Secret decrypts messages.)

Well, I've done this for the TI-85 already. Problem was, it used really, really cheesy 8-bit encryption. I can crack that in my head. But with the TI-92, I could program 384-bit encryption. That's the low end of commercial PC software, and the best part is: while it's not immune to the government, or even to a large corporation, it will defeat most anyone a high schooler fears. (Though a large, well-funded university could be amused for a month trying to break it.) I've already got plans as to how to actually implement this thing, too.

My question to everyone, is this concept of Calculator Encryption USEFUL or WORTHLESS? I've only thought of one application for this, but it probably has more. And there are more questions along with this: exactly what SORT of programs would be useful on a TI calculator? For example:

  • I got this idea for Calculator Encryption off of the PC program PGP.
  • The TI-92 Text Editor is basically a PC's NOTEPAD.EXE.
  • Spreadsheets?
  • Games? (Well, I know the answer to this one, but I had to mention it, else everyone would tell me I forgot it.)
  • General Purpose Compressors? (Very, VERY hard to implement, I would guess, but possible.)
  • Other programs?

Actually, the idea of the General Purpose Compressor is VERY interesting. Probably more interesting than Calculator Encryption. *ahem* I think I want to talk about that for a little while. Well, I've gone from a particular idea, to a general idea, back to a particular idea that will turn out to be pretty general. Hehehe. Anyways...

If one had (let's use an abbreviation) a GPC, what TI calculators could it run on? Of course, the TI-92+, the TI-92, and the TI-89. (After all, if it won't run on them, where WOULD a GPC run?) Most likely I could see a TI-86 or TI-85 assembly program running it. Putting a GPC on a TI-83 or TI-82 is doubtful, but maybe a programmer would find a way. Ironically, the more lower-end the calculator, the nifiter a GPC would be. A General Purpose Compressor would crunch programs/data into a smaller space, thus (in effect) giving you more memory, at the cost of not being able to use the compressed program until uncompression. Sort of like the TI-92+ data archive.

Now, I envision a BRIGHT future for a GPC. Imagine being able to store twice the amount of data your calculator should hold (it would probably be closer to 1.5x, but let's stick with 2x). For a TI-85, that's about 40K (or is it 50? I don't remember). For a TI-92, that would be 120K. For a TI-92+, it could store an absolutely amazing 1MB of data! (Though still, no single uncompressed program/data could be more than 180K. Ah, I'll live with it.)

In fact, games (arrrgh! Ah well, I suppose I have to explore what a GPC means to them too) could have a large compressed bundle of levels included with them. When one level is needed, it could be uncompressed, used, then recompressed to make room for the next level. Thus you could create truly massive games with 2x the amount of levels you'd have without a GPC.

And I bet there's all SORTS of nifty applications for a General Purpose Compressor. Though it's 3 in the morning, and I can barely think coherent thoughts. *ahem* I, for one, would love to craft a GPC, though I don't have the assembly skills to do so. Probably it'd be a project close to making a shell.

Right now, the Special Purpose Compressor I have in mind doesn't really compress at all. All it does is transform integers into strings. What it does it convert an integer into base 2. Then it converts the base 2 to base 64. This of course saves space, and makes a 384-bit integer into a 64-character string. This is because the binary expression "110010011011" can be represented as the hexadecimal (base 16) expression "C9B". I think. I'm rusty on my Bin-Hex translating skills. But a General Purpose Compressor could work on real numbers, strings themselves, lists, matrices, and programs.

What's odd is that a list on the TI-92 seems to take up less space than the identical list on the TI-85. Hmmmm. I do't have time to explore this further. (The reason follows). Perhaps it uses some sort of compression already.

Ah, a quick note: I've been writing articles with a very short amount of time between them, but I'll slow down - I go back to school soon. And it does take me a while to become obsessed enough about something to write a good article. :-D

Well, thank you for sticking with me through this long rant. I have enough of my thoughts, what I'd appreciate are YOUR thoughts! Let's see....

  • Would Calculator Encryption be a useful, or worthless idea?
  • Where else could Calculator Encryption be used?
  • What other programs would be useful or worthless?
  • Would the General Purpose Compressor be useful or worthless?
  • What could the General Purpose Compressor be used in?
  • Anything else?

  Reply to this item

Re: Article: "Calc Crypto and the GPC"
the flaming forkman

fork-balls forever

Reply to this comment    15 April 1999, 15:39 GMT

Programs that use weak encryption
Olathe  Account Info
(Web Page)

imcode(), a TI-89 BASIC program, uses weak encryption (it doesn't even use a key) :

1) It reverses the words in the message
2) It reverses the characters in the message
3) It adds a random character on the right and on the left of each space
4) It adds a random character to the beginning and to the end of the message
5) It goes through and converts the string to a list (at the same time encrypting each character) using the following :

seq(ord(mid(string,x,1)) + x xor x,x,1,dim(string))

To decrypt it, simply undo step 5 through step 1.

It may not work exactly like this (I couldn't see the actual program because it is edit-locked), but this will do exactly the same thing as the program.

This took six hours of free time, because I couldn't look at the BASIC program. It is even easier for a math teacher to just copy the program (when they take your calculator for the rest of the class) and use it to decrypt any future messages they come across.

Reply to this comment    19 August 1999, 21:26 GMT

Re: Calc Crypto and the GPC
jorge alarcon  Account Info
(Web Page)

Thanks for sharing your informative article that I thought was well written.

Reply to this comment    26 September 2011, 17:15 GMT

Re: Article: "Calc Crypto and the GPC"
Sean

wow, what a great idea

im the first one!

Reply to this comment    4 September 1998, 02:06 GMT


Re: Re: Article: "Calc Crypto and the GPC"
Jeff Min
(Web Page)

wow, what a great idea

im the second one! that doesn't count for anything, does it? oh well...

I can't think of much use for encryption, but that compression idea sounds pretty cool, provided the compressor itself doens't take up too much mem, and that it doesn't take too long to comp/decomp. I suppose a wait wouldn't be too bad anyway. And if it had one of those progress indicators, that would be a lot cooler than just loading up a regular game.

Reply to this comment    4 September 1998, 02:22 GMT


Re: Re: Re: Article: "Calc Crypto and the GPC"
S.T.L.
(Web Page)

Probably, the compression program would be of a middling size (I imagine 1 to 3K).

Reply to this comment    4 September 1998, 22:35 GMT

Re: Article: "Calc Crypto and the GPC"
Ю.Þ£ÞÞ£®
(Web Page)

The encyption would have to work with an ir link or something to that effect for it to be worthwhile *IMO*

Reply to this comment    4 September 1998, 02:22 GMT

Re: Article: "Calc Crypto and the GPC"
Paul DeLeeuw

Encryption can be done and done well, but I don't see it as useful. It would be, to me, no more than a toy. And 8 bit encrypion would still be plenty as long as the teacher doesn't know the method of encryption. As for the compression, compressing a 384-bit integer into a 64 byte string results in 520-bits (63 bytes) of space taken up by that string! Breaking it down:
8 bits * 64 characters in the string = 512 bits
8 bits null character to end the string.
This makes it increadably inefficient! In fact, compression at the bit level takes an increadably complex compression routine. Compressing, say, level matrices is much easier, but it would have to be greatly modified to be a "GPC". Thats my 2 cents, although it looks more like 2$ to me.

Reply to this comment    4 September 1998, 02:29 GMT

Re: Re: Article: "Calc Crypto and the GPC"
S.T.L.
(Web Page)

I knew the GPC would be difficult to program, but it probably could be done. By the way, please check your math. 384 bits is exactly 48 bytes. The method of compression I'm thinking of would transform it into a shorter string, though it would take more space. This is so people only have to write 64 or so characters, instead of 384 bits.

Reply to this comment    4 September 1998, 22:38 GMT


Re: Re: Article: "Calc Crypto and the GPC"
Anthony

I am interested in an encryption program. Could you give me some tips on making an encryption program.

Thanks.

Reply to this comment    25 February 1999, 02:09 GMT

MY opinions about the ideas in question.
Leon Pierre

IMHO, Compression very good, as long as it doesnt take too long. Encryption seems like one of those ideas that not everyonr would use. Sort of like the IR-link. Some people use it, but not everyone does. If the encryption could be used in any other way than to "pass notes" on your calc, then I might see a better use for it. Maybe storing sensitive data (locker combination, some of use are forgetfull..)? Encryption could be useful, but it doesnt seem greatly useful now, but maybe someone would find that "killer app" that would make it very useful. A program that would be useful though, imho, would be a shell that could send and receive programs and stuff w/o exiting to the linking screen, but that is out of topic (but you did ask "What other programs would be useful..."). But if the compressor idea could be ideally and efficiently executed, then it would take off. This is my opinion.

Reply to this comment    4 September 1998, 02:36 GMT


Re: MY opinions about the ideas in question.
The Guy
(Web Page)

That shell is coming, my friend.

Reply to this comment    4 September 1998, 02:56 GMT


Re: Re: MY opinions about the ideas in question.
eric

Here's what I want to see, built in support for that E2 mem expander in shells, especially the 82 since the vat is all screwy.

Reply to this comment    4 September 1998, 03:16 GMT


Re: Re: Re: MY opinions about the ideas in question.
Matt

I, for one would flip head over heals at a shell with E2 built-in. A game with access to 500k+ of memory could be soo good (doom w/ sound, ect). You could have a billion 26k files then lil' ones to link them all.

Reply to this comment    4 September 1998, 08:01 GMT

Re: Article: "Calc Crypto and the GPC"
Jbrett
(Web Page)

There is a LZSS based compression program for the ti-86 called BLOAT. It is by Matthew Shepcar.

Reply to this comment    4 September 1998, 02:38 GMT

Re: Article: "Calc Crypto and the GPC"
Alan Wong

I'll keep this short and too the point. The following comment will defeat all other comments made against this possibly very useful tool (still can't think of how it can be used yet, but it can be):

Why not?

Wouldn't it be useful just to have it? Its like owning a computer that costs a million dollars. Everyone wants it. Its there, and its elusive. But when you get it, you have no clue what to do with it since its so damn powerful!

Alan Wong
Damnation

Reply to this comment    4 September 1998, 02:53 GMT

Re: Article: "Calc Crypto and the GPC"
John "Cryect" Rittenhouse

I think instead of using public key algorithms how about using the IDEA encryption algorithm
I did write my own algorithm and programed it in basic that used like a 64bit password and saved the message as a picture(even sneaker than a string caus who would guess else than it looks wierd). THe only problem it took forever to encrypt and my friends calculator link port got damaged which I programmed it on since at the time I didnt hve a ti-86.

Reply to this comment    4 September 1998, 03:02 GMT


Re: Re: Article: "Calc Crypto and the GPC"
S.T.L.
(Web Page)

IDEA is programmable, but it has certain, *ahem* patent issues. I am not sure exactly what they are. Besides, then the program needs a cryptographically secure random number generator. Besides, link cables are "secure" lines - they cannot be tapped. Public-key would allow for people to leave messages on blackboards, etc. Besides, RSA is very math-oriented. Not like IDEA, which is computation-oriented.

Reply to this comment    4 September 1998, 23:43 GMT


Re: Re: Re: Article: "Calc Crypto and the GPC"
James Split

I think that this looks very interesting. I have only one thought on something that might pose a problem. How are people supposed to access this blackboard. Am I correct in thinking that this blackboard exists on some kind of server? This sounds really cool but very difficult.

Reply to this comment    5 September 1998, 03:10 GMT


Re: Re: Re: Re: Article: "Calc Crypto and the GPC"
S.T.L.
(Web Page)

It's not as difficult as a GPC, that's for sure.
By the way: when I say blackboard, I mean a little board in a classroom made of slate that people write on with chalk. :-D

Reply to this comment    5 September 1998, 20:23 GMT

Re: Article: "Calc Crypto and the GPC"
Cody Zimmerman

I think that compression idea is great but I think having to decompress the program to use it is a pain in the ass even if decompression time is short. What we need is a compression program that can compress as well as the program you described but doesn't need to decompress programs for them to work. Being able to have double or even 1.5x the memory would be useful especially for the TI-82 and 83 and even better and cooler when you have 98K of memory like on the TI-86. That's like 147K to 196K of memory for the TI-86!!! That would be absolutely and undeniably AWESOME beyond comprehension. Especially if you had a TI-89 or TI-92 or 92+.

Reply to this comment    4 September 1998, 05:26 GMT

Re: Re: Article: "Calc Crypto and the GPC"
R. Rhodes  Account Info

I was looking for a program for ti-83 plus or windows that can make another program take up less memory, but not with all the compression and decomprssion. Like a "cruncher". Like something that would eliminate all unesscesary info or programming.


Anayways the encryption thing would be cool, but I would have no use for it. It would be more of a toy. If I were you I would do it anyways as a sort of a test or something.

Reply to this comment    20 June 2000, 05:54 GMT

gzip?
SHEENmaster  Account Info
(Web Page)

Why not just port the gnu zip program from gcc to tigcc. Cutting out the fluff would be easy, and it is open source so patent problems wouldn't apply.

Reply to this comment    11 January 2002, 18:53 GMT


Re: Re: Article: "Calc Crypto and the GPC"
Kemon Kemon  Account Info

I think a GPC would be great, however to try to run a program without decompressing is ludicrous. The main problem is that you would have to run it interpretively, it be like running a basic form of ASM it'd be much slower (though smaller) and would eat your batteries faster (it'd have to run constantly to make up time). In short, temporary decompression wouldn't be bad, just unzip when needed an zip when done.

-Rejun
Thanks

Reply to this comment    9 February 2002, 02:16 GMT


Re: Re: Re: Article: Calc Crypto and the GPC
Paul Hymen  Account Info
(Web Page)

I assume a GPC would be exquisite, however to attempt to run a software without decompressing is ludicrous. The essential problem is that you would ought to run it interpretively, it be like jogging a fundamental form of ASM it might be a whole lot slower (although smaller) and might eat your batteries quicker (it would have to run continuously to make up time). In brief, temporary decompression would not be awful, simply unzip when wanted an zip while finished.

Reply to this comment    15 August 2021, 13:05 GMT

1  2  3  4  5  6  

You can change the number of comments per page in Account Preferences.

  Copyright © 1996-2012, the ticalc.org project. All rights reserved. | Contact Us | Disclaimer