home *** CD-ROM | disk | FTP | other *** search
/ Between Heaven & Hell 2 / BetweenHeavenHell.cdr / 100 / 1 / crypto.arc / CPUB.DOC < prev   
Text File  |  1985-11-05  |  18KB  |  463 lines

  1.  
  2.  
  3.  
  4.                                                        
  5.  
  6.  
  7.  
  8.  
  9.                                CPUB
  10.  
  11.                     A PUBLIC-KEY CRYPTOSYSTEM
  12.  
  13.                         INSTRUCTION MANUAL
  14.  
  15.  
  16.                         (C) COPYRIGHT 1985
  17.                           ARTHUR MELNICK
  18.                        ALL RIGHTS RESERVED
  19.  
  20.  
  21.                THIS SOFTWARE IS USER-SUPPORTED.   IT MAY 
  22.           BE  COPIED AND DISTRIBUTED FREELY,  HOWEVER IT 
  23.           MAY  NOT BE SOLD.   IT IS COPYRIGHTED  BY  THE 
  24.           AUTHOR   AND  HE  HOLDS  ALL  RIGHTS  TO   ITS 
  25.           DISTRIBUTION.   WHEN  COPIED,  IT  MAY NOT  BE 
  26.           CHANGED OR MODIFIED IN ANY WAY.
  27.  
  28.                IF  YOU  FIND  THIS  PROGRAM  USEFUL,   A 
  29.           DONATION OF $25 IS REQUESTED.
  30.                SEND DONATIONS TO:
  31.  
  32.                          ALMTEK
  33.                          P.O. BOX 6425
  34.                          SAN RAFAEL, CA. 94903
  35.  
  36.                IF YOU USE THIS SOFTWARE FOR BUSINESS  OR 
  37.           COMMERCIAL  PURPOSES,   THE  DONATION  IS  NOT 
  38.           OPTIONAL.
  39.  
  40.                USERS ALSO SENDING THEIR NAME AND ADDRESS 
  41.           WILL  RECEIVE A COLLECTION OF PROGRAMS  CALLED 
  42.           THE DATA SECURITY TOOL KIT, WHICH IS DESCRIBED 
  43.           AT THE END OF THIS MANUAL.
  44.  
  45.                THIS SOFTWARE AND MANUAL ARE PROVIDED "AS 
  46.           IS"  AND WITHOUT WARRANTIES AS TO  PERFORMANCE 
  47.           OR  MERCHANTABILITY OR ANY EXPRESS OR  IMPLIED 
  48.           WARRANTIES  WHATSOEVER.   THE USER MUST ASSUME 
  49.           THE ENTIRE RISK OF USING THE SOFTWARE.
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. I.  WHAT IS A PUBLIC-KEY CRYPTOSYSTEM?
  71.  
  72.      The  desire  to  send messages in a form which  can  not  be 
  73. understood  by  anyone  other  than the  intended  recipient  has 
  74. existed  for  centuries.   Codes and ciphers have  been  devised, 
  75. used,  and  improved upon throughout history.   In spite of this, 
  76. people  have been trying to circumvent the system and  read  each 
  77. other's mail anyway for just as long.
  78.      One thing which has remained constant through all of this is 
  79. the need for a secret "key" or password, known only to the sender 
  80. and intended receiver of the communication,  which is required to 
  81. unlock  the hidden message.   Without this key,  an  unauthorized 
  82. third  party who happens to gain access to the coded message will  
  83. be unable to decipher it.   The need for a key or password  does, 
  84. however, create some inconvenience.
  85.      Let  us suppose that Tom wishes to receive a secret  message 
  86. from  Nancy  using  some suitable code.   Tom must first  find  a 
  87. secure  way  of  communicating to Nancy the key she must  use  to 
  88. encode  the  message,  because he must then use the same  key  to 
  89. decode  it.   If some third party should gain access to the  key, 
  90. then they could decode the message at will.
  91.      If  at  some subsequent time Tom wishes to  receive  another 
  92. message from Nancy,  he has two choices.   He may again,  through 
  93. some secure means,  communicate another key to her, or he may use 
  94. the  first key over again.   The problem with using the same  key 
  95. over   again  is  that  if  the  code  has  any  weakness   (i.e. 
  96. "breakability")  at  all,  a  potential code breaker has  a  much 
  97. better chance of breaking the code if he or she is provided  with 
  98. two  samples  of the code in the form of two  different  messages 
  99. which have been encoded with the SAME key.
  100.      Now  let us suppose that Tom also wants to receive a  secret 
  101. message from LaVerne.   He again must, through some secure means, 
  102. communicate a key to LaVerne.
  103.      He can, of course, use the same key he used for his messages 
  104. from  Nancy.   There  are two potential problems with this  idea.  
  105. The first is the obvious one that Nancy can now read his messages 
  106. from  LaVerne.   The other is that now that two people  know  the 
  107. key, there is twice as much chance that someone with knowledge of 
  108. the   key  will  wittingly  or  unwittingly  divulge  it  to   an 
  109. unauthorized party.
  110.      Tom's  problems grow with time as he starts receiving  coded 
  111. messages from Shirley and Maxine.   He must either distribute new 
  112. keys  through  secure channels to each new correspondent  on  his 
  113. list,  or  he must accept the ever increasing risks of using just 
  114. one common key for all.
  115.      In the late 1970's two bright gentlemen named Martin Hellman 
  116. and  Whitfield Diffie came up with a solution to Tom's  problems.  
  117. Their  solution  calls  for  structuring the  code  so  that  two 
  118. different keys are used.  The first key is used only for encoding 
  119. the message and can not be used for decoding.   The second key is 
  120. used  for  decoding  and can not be used  for  encoding.   If  an 
  121. unauthorized  person intercepts the coded message,  he or she can 
  122. not decode the message even if the are in possession of the first 
  123. (encoding) key.
  124.      There  must,  of course,  be some mathematical  relationship 
  125.  
  126.  
  127. PAGE 1                (c) COPYRIGHT 1985 ARTHUR MELNICK
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. between between the two keys,  but in a practical system of  this 
  137. type,  this relationship is so complex and so well hidden that is 
  138. not  possible  with the resources available today to  ferret  out 
  139. this relationship and thereby break the code.
  140.      Tom  can  now distribute the same encoding key  to  everyone 
  141. without  caring who overhears it.   He need only insure that  the 
  142. DECODING  key  remains  secret  and he need not  reveal  that  to 
  143. anyone.  Tom could even distribute the key through a newspaper or 
  144. by writing it on a wall or any other public means (hence the name 
  145. public-key  cryptosystem).   Anyone could send him a message  and 
  146. only he could decode it.   Not Nancy.   Not LaVerne.  Not Gloria. 
  147. Only him.
  148.  
  149. II.  AN OVERVIEW OF CPUB
  150.  
  151.      CPUB  is  a  public-key cryptosystem of the  type  described 
  152. above.  It consists of three individual programs:
  153.  
  154.      CPGN      CPGN  is  used it GeNerate or create the two  keys 
  155.            required  to make the system work.   Most  users  will 
  156.            only need to run CPGN once,  however it will produce a 
  157.            different set of compatible keys each time it is run.
  158.  
  159.      CPEN      CPEN  is  used to ENcode any file using  a  public 
  160.            encoding key produced by CPGN.
  161.  
  162.      CPDC      CPDC  is used to DeCode,  using a secret  decoding 
  163.            key  produced by CPGN,  any file that  has  previously 
  164.            been encoded by CPEN.
  165.  
  166.      All  three of these programs run on an IBM PC or  compatible 
  167. using the MS-DOS operating system version 2.0 or later  (higher).  
  168. 64  K  of  memory is required.   The programs will operate  on  a 
  169. system having a monochrome or color monitor and at least one disk 
  170. drive is required.  Hard disks are supported.
  171.      The user is expected to possess a basic knowledge of the MS-
  172. DOS  operating  system.   Files  acted on by the  system  may  be 
  173. specified by the user with an optional drive, path, and extension 
  174. so long as they conform to MS-DOS standards.
  175.      Errors  are trapped.   This means that if a program can  not 
  176. proceed for some reason,  it will display a message on the screen 
  177. informing the user of what is happening instead of just  aborting 
  178. with  no  explanation.   Most error messages are not detailed  in 
  179. this  instruction manual,  however they are all self  explanatory 
  180. (e.g. "DISK FULL?").
  181.  
  182. III. CPGN
  183.  
  184.      CPGN  creates  two  files on the default  drive.   The  file 
  185. "CPUB.ENC",  created  by CPGN,  contains the public encoding  key 
  186. used to encode files.  The file "CPUB.DEC", also created by CPGN, 
  187. contains the secret decoding key needed to decode files.
  188.      Each of these two files is 8192 bytes long.  The user should 
  189. assure that there is enough room on his default disk to hold  the 
  190. files before he runs the program.
  191.  
  192.  
  193. PAGE 2                (c) COPYRIGHT 1985 ARTHUR MELNICK
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.      The  program  takes from 30 seconds to a minute to  run  and 
  203. will  occasionally display "*" characters on the screen to assure 
  204. the user that his computer has not died.
  205.      The  program  assigns  a ten letter serial  number  to  each 
  206. compatible pair of key files. An example of a serial number might 
  207. be "SEKMPOLLQW".  This is NOT the actual key used in the encoding 
  208. and decoding calculations but just a random serial number used to 
  209. distinguish  one key pair from another.   The user can  determine 
  210. the serial number after the files have been created with the  DOS 
  211. command  "TYPE  CPUB.ENC".   The computer will then  display  the 
  212. message:
  213.  
  214.                  PUBLIC ENCODING KEY XXXXXXXXXX.
  215.  
  216. where  XXXXXXXXXX is replaced by the serial number for an  actual 
  217. file.  Similarly the DOS command "TYPE CPUB.DEC" will display the 
  218. message:
  219.  
  220.                  SECRET DECODING KEY XXXXXXXXXX.
  221.  
  222.      The  files  CPUB.ENC and CPUB.DEC can and should be  renamed 
  223. after  they have been created.   In this way a user can  use  the 
  224. CPUB  system  to send coded information to more than  one  person 
  225. since each receiver is likely to have their own public key.   For 
  226. example,  two  different  versions of CPUB.ENC might  be  renamed 
  227. "LAVERNE.ENC"  and MARSHA.ENC".   The serial numbers of the  keys 
  228. can,  of  course,  still be determined after the files have  been 
  229. renamed   with   the   "TYPE  FILENAME"   command   (e.g.   "TYPE 
  230. LAVERNE.ENC").
  231.  
  232. IV. CPEN
  233.  
  234.      CPEN  encodes  a file using a public encoding key which  has 
  235. been produced by CPGN.
  236.      CPEN  requires that the user specify three files for  it  to 
  237. process:
  238.  
  239.           INPUT FILE:         INPUT  FILE  is  the  file  to   be 
  240.                          encoded.
  241.  
  242.           OUTPUT FILE:        OUTPUT  FILE is the file which will 
  243.                          contain  the encoded  information  after 
  244.                          the  program  has run.   If an  existing 
  245.                          file  has been specified by the user  as 
  246.                          the  OUTPUT FILE,  the program will  ask 
  247.                          the  user  if he wants to  overwrite  it 
  248.                          before proceeding.   Overwriting a  file 
  249.                          destroys its original contents.
  250.  
  251.           KEY FILE:           The  KEY  FILE  must  be  a  public 
  252.                          encoding  key produced by CPGN.   If KEY 
  253.                          FILE  is not in the proper  format,  the 
  254.                          program  will  not accept  it  and  will 
  255.                          prompt the user for another file name.
  256.  
  257.  
  258.  
  259. PAGE 3                (c) COPYRIGHT 1985 ARTHUR MELNICK
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.      Since  the OUTPUT FILE will be longer than the  INPUT  FILE, 
  269. the user may not specify the same file for both.
  270.      The user may enter the names of the three files in either of 
  271. two ways.
  272.      First,  he  may start the program by entering "CPEN" on  the 
  273. DOS command line.   The program will run and will prompt the user 
  274. for  the  names of the three files in turn.   If the user  enters 
  275. "CONTROL  BREAK" or "CONTROL C" in response to  any  prompt,  the 
  276. program will immediately abort and return to DOS.
  277.      The  second way the user may specify the names of the  three 
  278. files  to be processed is to start the program by entering on the 
  279. DOS command line:
  280.  
  281.            CPEN [INPUT FILE] [OUTPUT FILE] [KEY FILE]
  282.  
  283. where  INPUT FILE,  OUTPUT FILE,  and KEY FILE are as  previously 
  284. defined.   Each  file name must be separated from the  proceeding 
  285. one by one or more spaces.  If only INPUT FILE or only INPUT FILE 
  286. and  OUTPUT FILE are specified on the command line,  the names of 
  287. the remaining files will be prompted for when the program runs.
  288.      After  the  program completes its processing  the  user  may 
  289. enter  on the DOS command line the command "TYPE filename"  where 
  290. filename is replaced by the name of the just created OUTPUT FILE.
  291. The following message will then be displayed:
  292.  
  293.           ENCODED WITH PUBLIC ENCODING KEY XXXXXXXXXX.
  294.  
  295. where  XXXXXXXXXX is replaced by the serial number of the  public 
  296. encoding  key used to encode the file.   In this way a file which 
  297. contains information encoded by the CPUB system can be identified 
  298. and the encoding serial number can be determined.
  299.  
  300. V. CPDC
  301.  
  302.      CPDC decodes a file which has been encoded by CPEN.
  303.      CPDC  requires  the  user to specify three files for  it  to 
  304. process:
  305.  
  306.           INPUT FILE:         The   INPUT   FILE   contains   the 
  307.                          information  which has  previously  been 
  308.                          encoded by CPEN.   If the user specified 
  309.                          INPUT FILE is not in the proper  format, 
  310.                          the  program will not accept it and will 
  311.                          prompt for another INPUT FILE.
  312.  
  313.           OUTPUT FILE:        The  decoded  information  will  be 
  314.                          written   to  OUTPUT  FILE.    The  same 
  315.                          cautions  that apply to  CPEN  regarding 
  316.                          overwriting    the   output   file   and 
  317.                          specifying  the  same  input  file   and 
  318.                          output file also apply to CPDC.
  319.  
  320.           KEY FILE:           The  KEY  FILE  must  be  a  secret 
  321.                          decoding  key produced by CPGN.  If  the 
  322.                          KEY  FILE  is not in the proper  format, 
  323.  
  324.  
  325. PAGE 4                (c) COPYRIGHT 1985 ARTHUR MELNICK
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.                          the program will not accept it and  will 
  335.                          prompt the user for another file name.
  336.  
  337.      The encoding serial number of INPUT FILE must be the same as 
  338. the  decoding  key serial number of KEY FILE or the program  will 
  339. not  accept  that  KEY FILE specification  and  will  prompt  for 
  340. another one.
  341.      The  user  may  enter  the names of the three  files  to  be 
  342. processed by CPDC in either of the two ways detailed for  program 
  343. CPEN.
  344.  
  345. VI. SECURITY AND SPEED
  346.  
  347.      When  a file is encoded by CPEN,  extra information is added 
  348. to the output file in a random way.  When that file is decoded by 
  349. CPDC, the program checks that the same extra information is still 
  350. present  in the encoded file.   This is done to  prevent  someone 
  351. from  trying  to  "spoof"  the  file  by  modifying  the  encoded 
  352. information.   When  CPDC detects that the encoded file has  been 
  353. changed, it displays the message
  354.  
  355. FILE filename HAS BEEN ALTERED!
  356. PROCEED? (Y/N):
  357.  
  358.      If the user enters an "N", the program will abort.  If a "Y" 
  359. is entered, the program will continue until the entire INPUT FILE 
  360. has been decoded or another error is detected,  at which time the 
  361. same message is repeated.
  362.      The  CPUB public-key cryptosystem is designed to operate  at 
  363. high  speed in the personal computer environment.   Files can  be 
  364. encoded  and  decoded  at  a rate of 2 to 3  thousand  bytes  per 
  365. second.   The mathematical formula (algorithm) used achieves this 
  366. speed  by sacrificing some measure of security.   A  person  with 
  367. a  strong  background  in the mathematics of  code  breaking  and 
  368. access  to a large and powerful computer could,  in  time,  break 
  369. this  code.   If the information that the user wishes to  protect 
  370. involves  the survival of the free world,  then the author  would 
  371. prefer that some other, more secure, code is used.
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391. PAGE 5                (c) COPYRIGHT 1985 ARTHUR MELNICK
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.                    THE DATA SECURITY TOOL KIT
  401.  
  402.      The  Data  Security  Tool Kit is a  collection  of  programs 
  403. designed to allow the user to send,  receive,  store and use data 
  404. and  program  files  while  denying  access  to  those  files  to 
  405. unauthorized personnel.
  406.  
  407.      The programs include:
  408.  
  409.      CERA      CERA deletes files from a disk or diskette in such 
  410.           a way so that they can not be "undeleted".
  411.  
  412.      CDES      CDES   encrypts  and  decrypts  files  using   the 
  413.           National  Bureau of Standards Data Encryption Standard.  
  414.           In addition to the usual "electronic code book" mode of 
  415.           operation,  CDES also supports the more secure  "cipher 
  416.           block chaining" mode.
  417.  
  418.      CEX       CEX expands a binary file into an ASCII file which 
  419.           may  be  sent  or received by a  communications  program 
  420.           which only supports 7 bit ASCII files.
  421.  
  422.      CMP       CMP compresses ASCII files produced by CEX back to 
  423.           their original 8 bit format.
  424.  
  425.      CX        CX  encrypts and decrypts files using a  key  file 
  426.           which  is at least as long as the file to be  encrypted 
  427.           or  decrypted.   If an existing program or data file is 
  428.           used as a key,  CX produces a "running key" or Vigenere 
  429.           cipher.   If a file of random numbers is used as a key, 
  430.           CX  produces  a "one time pad" cipher,  the  only  code 
  431.           which can be mathematically proven to be unbreakable.
  432.  
  433.      CGR       CGR,   when  used  in  conjunction  with  an   AST 
  434.           RESEARCH,  INC. "SixPak" multifunction card, produces a 
  435.           block  of  random numbers in memory.   It does this  by 
  436.           using  the  SixPak card's clock to  time  the  interval 
  437.           between user key strokes.
  438.  
  439.      CBR       CBR  writes or appends the block of random numbers 
  440.           produced by CGR to a disk file so that they may be used 
  441.           as a key file by CX.
  442.  
  443.      CWR       CWR  writes  a file to a diskette  and  completely 
  444.           bypasses  the  diskette's directory.   Since  CWR  also 
  445.           scrambles the file, it is very difficult for someone to 
  446.           determine that the file is even there.                 
  447.  
  448.      CRD       CRD reads files from diskettes written by CWR.
  449.  
  450.      CFC       CFC  (FastCryp)  is a fast  cryptographic  program 
  451.           which  encodes and decodes at better than 4K bytes  per 
  452.           second.
  453.  
  454.  
  455.  
  456.  
  457. PAGE 6                (c) COPYRIGHT 1985 ARTHUR MELNICK
  458.  
  459.  
  460.  
  461.  
  462.  
  463.