home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / sci / crypt / 7062 < prev    next >
Encoding:
Text File  |  1993-01-21  |  2.7 KB  |  69 lines

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