home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 20 / 020.d81 / t.scrambler < prev    next >
Text File  |  2022-08-26  |  3KB  |  188 lines

  1.  
  2.              Scrambler
  3.  
  4.  
  5.  
  6. Written by:  Bruce Jaeger
  7.  
  8.  
  9.   Scrambler is a handy little
  10.  
  11. machine-language utility that allows
  12.  
  13. you to scramble and unscramble (i.e.
  14.  
  15. encipher and decipher) your data
  16.  
  17. strings. Familiar to all of us is the
  18.  
  19. subsitution method, for example, all
  20.  
  21. A's become Z's; etc., however
  22.  
  23. Scrambler uses a method that is a
  24.  
  25. little more clever--the transposition
  26.  
  27. method.
  28.  
  29.   A transposition cipher hides the
  30.  
  31. message by rearranging the letters in
  32.  
  33. a predetermined sequence and reveals
  34.  
  35. that same message by reversing the
  36.  
  37. process. For an example, consider the
  38.  
  39. following:
  40.  
  41.  
  42.   If our message is 'WE WILL MEET AT
  43.  
  44. 12:00 NOON,' we might arrange the text
  45.  
  46. as shown below.
  47.  
  48.               W E W I L
  49.               L M E E T
  50.               A T 1 2 :
  51.               0 0 N O O
  52.               N E E E E
  53.  
  54. (The extra E's on the end are padded
  55. to make an even matrix.)
  56.  
  57.   With this method, our text would
  58.  
  59. read, 'WLA0N EMT0E WE1NE IE2OE LT:OE.'
  60.  
  61.   Scrambler transposes text a
  62.  
  63. character string at a time. The
  64.  
  65. maximum length is 255 characters and
  66.  
  67. these characters may be of any type
  68.  
  69. (e.g. alphanumeric, color codes,
  70.  
  71. cursor commands, etc.). The keyword
  72.  
  73. used to encipher a message can be of
  74.  
  75. any length between 1 and 255,
  76.  
  77. inclusive.
  78.  
  79.   When RUN, Scrambler pokes a machine
  80.  
  81. language routine in memory starting
  82.  
  83. at 49152 ($C000). Memory at 49664-
  84.  
  85. 49919 ($C200-$C2FF) is used for
  86.  
  87. workspace, so be sure not to store
  88.  
  89. any other routines there.
  90.  
  91.   Within your programs, Scrambler is
  92.  
  93. called using the following format:
  94.  
  95.     SYS(49152),X,KEY$,TEXT$
  96.  
  97. where X equals a zero to encode a
  98.  
  99. message; or X equals a one to decode
  100.  
  101. a message.
  102.  
  103.   KEY$ contains the keyword. If the
  104.  
  105. keyword is "dog", then Scrambler will
  106.  
  107. transpose the message four times,
  108.  
  109. once using the ASCII value of each
  110.  
  111. character of the keyword, plus a
  112.  
  113. final time using the sum of the
  114.  
  115. characters' values. Remember that the
  116.  
  117. keyword must be at least one
  118.  
  119. character long.
  120.  
  121.   Initially, TEXT$ contains the
  122.  
  123. message to be scrambled. After the
  124.  
  125. message has been scrambled, TEXT$
  126.  
  127. will contain the scrambled message.
  128.  
  129.   The names of the variable strings
  130.  
  131. are not important, as long as they
  132.  
  133. are arranged correctly (i.e. they are
  134.  
  135. in the correct position in the SYS
  136.  
  137. statement).
  138.  
  139.   There are two Scrambler demos on
  140.  
  141. this issue of LOADSTAR.  If you choose
  142.  
  143. to RUN Scrambler, you will be given a
  144.  
  145. small menu from which you can choose
  146.  
  147. either demo.
  148.  
  149.   If running Scrambler outside of the
  150.  
  151. LOADSTAR environment, then you first
  152.  
  153. need to LOAD and RUN 'SCRAMBLER.LOAD'.
  154.  
  155. This program pokes in the machine
  156.  
  157. language routine.
  158.  
  159.  
  160.               ------
  161.  
  162.    This program is copyrighted by
  163.  
  164.  Commodore Microcomputers magazine.
  165.  
  166.    All rights to it are reserved.
  167.  
  168.  LOADSTAR has relieved you from the
  169.  
  170.   burden of keying in this program.
  171.  
  172.  For more complete information about
  173.  
  174.  this program, refer to the February
  175.  
  176.        1986 issue of Commodore
  177.  
  178.             Microcomputers.
  179.  
  180.  
  181. >Files used: SCRAMBLER       <==menu
  182.              SCRAMBLER.LOAD  <==pokes
  183.              SCRAMBLE.49152
  184.              SCRAMBLER DEMO1
  185.              SCRAMBLER DEMO2
  186.  
  187. --------< end of article >------------
  188.