home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: sci.crypt
- Path: sparky!uunet!newsgate.watson.ibm.com!yktnews2.watson.ibm.com!yktnews!admin!wo0z!lwloen
- From: lwloen@rchland.vnet.ibm.com (Larry Loen)
- Subject: Re: Programs in BASIC please
- Sender: news@rchland.ibm.com
- Message-ID: <1993Jan21.170934.26621@rchland.ibm.com>
- Date: Thu, 21 Jan 1993 17:09:34 GMT
- Distribution: usa
- Reply-To: lwloen@rchland.vnet.ibm.com
- Disclaimer: This posting represents the poster's views, not necessarily those of IBM
- References: <C17KGp.3tw@world.std.com>
- Nntp-Posting-Host: wo0z.rchland.ibm.com
- Organization: IBM Rochester
- Lines: 53
-
- In article <C17KGp.3tw@world.std.com>, jcluett@world.std.com (Jim Cluett) writes:
- |> Could any of you point me to an encryption program or two,
- |> written in BASIC that would be suitable for beginners? Security
- |> is not important. Just looking for some introductory material
- |> that would be fun and educational for students. Thanks. e-mail to
- |> jcluett@world.std.com.
- |>
- |>
-
- If someone sends them to you, well and good. But, this stuff is entirely
- suitable for even beginner students to write from scratch if the system
- is simple enough.
-
- If no one sends you code, I suggest getting a copy of H F Gaines'
- "Cryptography" and looking at any of the following:
-
- Vigenere (and its variants, possibly excepting Porta)
-
- Simple Substitution
-
- Quagmire
-
- Complete Columnar Transposition
-
- and code them up yourself.
-
- All of these are somewhere between 20 and 50 lines of code in BASIC,
- especially if one uses READ/DATA instead of file I/O to provide the input.
- Porta is not all that much harder than the rest, but it might be left out
- of a beginner's course simply because it has the same security as the others
- and is a bit nasty to program.
-
- Also, with a little discipline, one can often use fragments of one program
- to do the next one. Be sure to teach about MID$(a$,i,1) kind of stuff (or
- whatever your BASIC has for string manipulation). If there is a LSET A$=
- type command available, it can also be very handy along with MID$(A$,I,1)= exp
- kind of stuff.
-
- You can get by without the fancy string stuff, too, but it is handy sometimes.
- (Teaching strategy question: Do you teach string manipulation, or do you
- teach them to extract characters, translated to integers, and manipulate
- ordinary integer arrays and then translate back to a string? Or, let the
- students choose? For some of these "historical" ciphers, translating the input
- to the number string A=0, B=1, ...Z=25 is often the key insight. In other
- systems, one can settle for shuffling the strings).
-
- The other systems in the book can also be done and very few of them would
- take over 100 lines of BASIC code to do.
-
-
- --
- Larry W. Loen | My Opinions are decidedly my own, so please
- | do not attribute them to my employer
-