home *** CD-ROM | disk | FTP | other *** search
/ CD-ROM Magic 1995 #1 / CDM_5.ISO / shell / mailers / im / imcrypt.arj / IMCRYPT.DOC < prev    next >
Encoding:
Text File  |  1993-12-27  |  14.3 KB  |  347 lines

  1.                         ImCrypt v 0.2 alfa
  2.  
  3. Overview
  4. ========
  5.  
  6. ImCrypt is a utility for MS-DOS platforms to facilitate sending and
  7. receiving PGP encrypted messages via FidoNet (tm) style e-mail. 
  8.  
  9. What it basicly does is scanning the netmail directory for message addressed
  10. to one of your users at one of your AKA's, separating the message text from
  11. the headers and the kludges in messages, running PGP to encrypt or decrypt
  12. the message text and making new messages from the old headers and kludges
  13. and the modified text.
  14.  
  15. ImCrypt is tuned for InterMail 2.2 or higher. For this pre-release version
  16. that means it will ONLY work in the InterMail environment. The final
  17. release version may or may not have provisions to work in other environ-
  18. ments that use a *.msg netmail base.
  19.  
  20. IMCRYPT ?  will give a short help screen.
  21.  
  22.  
  23. Copyright notice
  24. ----------------
  25.  
  26. ImCrypt may be freely distributed by any means provided that all the files
  27. are distributed as a package and unchanged. No distribution fee may be im-
  28. posed, other then the immidiate cost involved in the distribution itself.
  29. Repacking to another compressed format is allowed. Adding a BBS header is
  30. no problem. Distributing packages with other modifications is not allowed.
  31.  
  32. Noncommercial use within fidonet or a fidonet-like environment is free. For
  33. commercial use, please contact the author.
  34.  
  35.  
  36. The distrubution package
  37. ========================
  38.  
  39. The distribution package contains the .EXE file, the documentation
  40. and the C source file. The main purpose of distributing the source file is
  41. to enable interested partys to verify for themselves that no dirty tricks
  42. have been build in to compromise the security offered by PGP. You may use 
  43. it for any other legal non-commercial purpose if you like, but you may not
  44. distribute modified versions of the source without the authors permission.
  45. Additional information may be found in the READ.ME file.
  46.  
  47.  
  48. The environment
  49. ===============
  50.  
  51. ImCrypt takes most of the parameters needed from the InterMail configuration
  52. file FD.SYS. In order to do this, it must be able to find this file.
  53. The environment variable "IM" must be set to do this. When ImCrypt is run
  54. from the main InterMail batch file, this will be no problem. When run from
  55. the command line, the user must ensure that the "IM" environment variable
  56. points to the directory where FD.SYS can be found. This can be done with
  57. de DOS SET command.
  58.  
  59. Due to the extensive use of environment variables, it may be nessecary to
  60. increease the environment spave with the DOSS SHELL command.
  61.  
  62. ImCrypt will find the netmail directory, the semaphore directory, your
  63. AKA's and your user names from FD.SYS.
  64.  
  65. As explained in the overview, ImCrypt calls PGP.EXE if it needs to encrypt
  66. or decrypt messages. To do this, it must be able to locate PGP.EXE, the
  67. public and secret key rings and the PGP pass frase. For an explanation
  68. of these, see the documentation of PGP.
  69.  
  70. There are five ways of letting ImCrypt know where to find PGP.EXE.
  71.  
  72. 1) See that PGP.EXE is in the current directory.
  73.  
  74. 2) Let the environment variable "PGPPATH" (without qoutes) point to it.
  75.  
  76. 3) Have the DOS PATH point to it.
  77.  
  78. 4) Enter the path to PGP.EXE in the config file IMCRYPT.CFG.
  79.  
  80. 5) Enter the path tot PGP.EXE with the "p" option on the command line.
  81.  
  82. If more than one of these options is active at the same time, the one
  83. later mentioned in this list has higher priority. The second method can
  84. only be used if PGP.EXE and the keyrings are in the same directory.
  85.  
  86. More about the IMCRYPT.CFG file and command line options later.
  87.  
  88.  
  89. For PGP to work, it must be able to locate the keyrings. Therefore the
  90. environment variable "PGPPATH" must be properly set. Note that ImCrypt
  91. itself does nothing with with this variable except use is as a last resort
  92. to locate PGP.EXE if it can't find it anywhere else.
  93.  
  94. The third thing that may be needed is the PGP pass frase. One way to do
  95. it, is to set the "PGPPASS" environment variable. Please read the relevant
  96. section in the PGP documentation. This method has its risks. These risks are
  97. explained in the PGP doc, much better than I could do it. Be sure to be
  98. aware of the risks of this method before using it.
  99.  
  100. An other way to do it, is to use the "-b" option on the command line or
  101. in IMCRYPT.CFG. PGP will then be called in interactive mode and will prompt
  102. for pass frase if needed. Be sure to be present at the keyboard if you use
  103. this mode.
  104.  
  105.  
  106. The semaphores
  107. ==============
  108.  
  109. Imcrypt will touch the semaphore files IERESCAN.NOW and IMRESCAN.NOW
  110. whenever it has changed one ore more messages in the netmail directory.
  111. It will also prevent another program from changing something in the netmail
  112. directory by handling the IMRENUM.NOW semaphore if it detects that is 
  113. not running in a single task environment.
  114.  
  115. The algorithm for detecting a multitask environment is as follows: first
  116. it will check if SHARE is loaded. If so, it will assume a multitask envi-
  117. ronment. If not, it will check if a network is perhaps present. It will
  118. check for the precense of MICROSOFT network, Lantastic, Starlan extended
  119. netbios or IPX. If either of these is active, a network is assumed if
  120. the semaphores are on drive F or higher. Note that the OS2 DOS box will
  121. trick ImCrypt into thinking SHARE is loaded.
  122.  
  123. If neither of these conditions is met, a single task environment is assumed
  124. and the IMRENUM.NOW semaphore is not used.
  125.  
  126. Checking for a multitasking environment is nessesary, because of the 
  127. peculiar way InterMail handles the IMRENUM.NOW semaphore. It depends on
  128. waiting for a lock to be established on a part of the file. In case of
  129. a single tasking environment, a lock can never be obtained, so it would
  130. wait forever. Unfortunatly there is no obvious way to tell if a lock has
  131. failed because a file is not sharable or because it is busy.
  132.  
  133. The automatic detection of a multitasking environment can be overridden
  134. with the "s" command line option. The detection mechanism is not perfect
  135. and may fail in some cases. "-s" tells IMCRYPT to always ignore IMRENUM.NOW
  136. and "+s" tells it to involve the locking mechanism always.
  137.  
  138.  
  139. Logging
  140. =======
  141.  
  142. Imcrypt provides for logging. The logging mechanism is invoked with the
  143. "l" option on the command line or in the config file.
  144. A single "l" will use IMCRYPT.LOG in the current directory. A full name
  145. and path may be specified with "l=filespec". A minus sign before the "l"
  146. will overwrite the log each time ImCrypt is called, otherwise it will 
  147. append new information to the end of an existing file. "l=*" will write
  148. the log information to the mailer #1 logfile. Use this only if ImCrypt
  149. is never called when mailer #1 is online or else a sharing violation
  150. may result.
  151.  
  152.  
  153. How does it work
  154. ================
  155.  
  156. ImCrypt scans the netmail directory for messages from you and for messages
  157. to you. A message is considered from you if its "from field" contains one
  158. of the names listed in FD.SYS and originates from one of your AKA's
  159. listed in FD.SYS. When comparing the names, case is ignored. If it finds
  160. such a message, and it is not yet marked as "send", it will scan the
  161. message for one of the following first lines:
  162.  
  163. PGP ENCRYPT
  164. PGP SIGN ENCRYPT
  165. PGP SIGN
  166. PGP CLEARSIG
  167.  
  168. The line may be hidden with an ^A kludge character. In that case, it
  169. need not be the first line. As far as I know there is no editor that can
  170. do this, but it does no harm to be prepaired.
  171. If it finds one of these, it will extract the message text and write it
  172. to a temporary file. It will then call PGP with this temporary file as input
  173. and will let PGP do the obvious thing. The output of PGP will be  used
  174. to build a new message with the original headers and kludges and the modified
  175. message text. The line "PGP xxx" or the PGP kludge that triggered the
  176. process is not written to the new message. Instead a naked ^APGP kludge is
  177. written to the new message.
  178.  
  179. The original message will be marked as "send". The new message will get
  180. the "kill-send" status, so that it will be removed by the mailer after it
  181. is send.
  182.  
  183.  
  184. If ImCrypt finds a message addressed to you, that does not have the
  185. in transit flag set, it will scan the message for the characteristic
  186. PGP header of five dashes and the words "BEGIN PGP". If it finds these,
  187. it will extract the message text, write it to a temp file and call PGP
  188. with this temp file as input to decrypt the text.
  189.  
  190. Depending on the "k" option, as explained later, it will replace the
  191. text in the original message or  build a new message. A "PGP" kludge in
  192. the message will be removed. In case the original message is retained it will
  193. replace the first of the five dashes in the PGP header with an asterisk, so
  194. that it does not recognise this message as crypted during subsequent passes.
  195.  
  196. ImCrypt was intended for use in the batch. Call it whenever new messages to
  197. you may have landed in your netmail directory, so whenever the mailer
  198. exits with mail received status or the tosser has finished unpacking
  199. the netmail. Call it also before letting your tosser pack the netmail or
  200. before sending mail to your up- or downlinks.
  201.  
  202. If you think this is unsafe (and unless you run an end user system, you
  203. have good reason to think so), you may also call ImCrypt from the DOS
  204. command line or from your favorite editor if your editor allows you to 
  205. that. In that case set the PGPPASS environment variable by hand or use
  206. the -B option to disable batch mode. 
  207.  
  208.  
  209. Options
  210. =======
  211.  
  212. The operation of ImCrypt is controled by option switches.
  213.  
  214. An option is a single letter, optionally prefixed with a
  215. slash '/', optionally followed by a string parameter. The letter and the
  216. string parameter may optionally be separated by a semicolon or an equals 
  217. sign. Both upper and lower case is allowed.
  218.  
  219. A minus sign before the option is sometimes used to negate or modify an
  220. option. In other case a minus sign is ignored.
  221.  
  222. The option 'l' can be written in the following variants.
  223.  
  224.  lFILENAME.EXT
  225.  l=FILENAME.EXT
  226.  /l:FILENAME.EXT
  227.  /l=FILENAME.EXT
  228.  -l
  229.  
  230. Filenames may be specified with a full path. If a directory is specified
  231. it need not be terminated with a backslash. ImCrypt adds it automatically
  232. if left off.
  233.  
  234. Options are specified on the command line, separated by a single space
  235. or in a file IMCRYPT.CFG in the current directory. A config file is a
  236. plain ASCII text file. It must contain one option per line with no leading
  237. or trailing spaces. Comment lines starting with a semicolon are allowed.
  238. A config file is not mandatory, but if it exists it is read before the
  239. command line is parsed. Therefore options on the command line will
  240. override options in the config file.
  241.  
  242.  
  243. The options in alfabetical order:
  244.  
  245.  -B  Disable batch mode. PGP is called in interactive mode and will prompt
  246.      for the pass frase or other information if needed. Do not use this
  247.      in unattended operation.
  248.  
  249.  -D  Skip the  decryption fase.
  250.  
  251.  -E  Skip the encryption fase
  252.  
  253.   K  Keep encrypted messages addressed to you. The decrypted content of
  254.      the message is written to a new message. Without this option no new
  255.      message is created, the old message is overwritten with the decrypted
  256.      text. Use of this parameter is recommended in the debug fase.
  257.  
  258.   L  Enable logging. A single "L" will use IMCRYPT.LOG in the current 
  259.      directory. A path and filename may be specified with l=<filespec>.
  260.      An asterisk for the filespec will use the #1 mailers log file. Be
  261.      carefull with this option in a multitasker or network environment.
  262.      Placing a minus sign in front of the "L" will cause the logfile to
  263.      be overwritten at each call of ImCrypt. Otherwise the logfile keeps
  264.      on growing.
  265.  
  266.   P  Specify a path for PGP.EXE. If PGP.EXE is not in the DOS path, this
  267.      tells ImCrypt where to find it. If this option is not used and
  268.      PGP is not found in the DOS path, ImCrypt will look for PGP.EXE
  269.      in the same directory as where the keys are located. The location
  270.      of the keys must be in the PGPPATH environment variable. If all of
  271.      this fails, the current directory will be searched for PGP.EXE.
  272.   
  273.   S  Overrides the autodetect of a multitasker or network. +S tells
  274.      ImCrypt to use the IMRENUM.NOW semaphore always, even if it finds
  275.      that it may not be sharable. -S tells it to never use it, even if
  276.      it  finds that it is sharable.
  277.  
  278.   T  Specify a directory for temporary files. Both ImCrypt and PGP make
  279.      use of temporary files. An alternative way to specify a temp direc-
  280.      tory is the environment variable TMP. By default ImCrypt will use
  281.      the semaphore directory as found in FD.SYS. Use of a ramdisk for the
  282.      temp. directory is recommended.
  283.  
  284.   V  Set verbosity. Valid parameters are V=0, V=1 and V=2. This provides
  285.      for extra information, mainly usefull for debugging purposes. Default
  286.      setting is V=0.
  287.  
  288.  
  289.  
  290. ImCrypt v0.2 is written in Turbo C and compiled with the tiny model.
  291. It is tested on 286 AT and 386 clones using MS DOS 5.0 and under NOVELL 3.11
  292. Because it does not use any fancy DOS or BIOS calls, there is no reason
  293. to suspect it should not work with anything above MS DOS 3.2 or any
  294. future versions of MS-DOS. However... no guarantee.
  295.  
  296. It was tested with InterMail 2.10 and 2.25. There is no reason it should 
  297. not work for any 2.x version. Ad regard to future versions; if the basic
  298. structure of the FD.SYS file remains upward compatible, it will most
  299. likely continue to function.
  300.  
  301. This version was tested with PGP v2.3a. Compatibilty with future versions
  302. is not guaranteed.
  303.  
  304.  
  305. DISCLAIMER
  306. ==========
  307.  
  308. Although all reasonable effort is made to avoid adverse side effects,
  309. the author accepts no responsibility whatsoever for any alleged damages
  310. resulting from the use of this program. It is not guaranteed to do any-
  311. thing else than take up disc space. 
  312.  
  313.  
  314. Acknowledgements
  315. ================
  316.  
  317. FidoNet is a trademark by Tom Jennings
  318.  
  319. InterMail is a trademark by Scandinavian PC Sytems AB and InterZone
  320. SoftWare Inc.
  321.  
  322. MS-DOS, OS/2 and Windows are trademarks of the Microsoft corporation.
  323.  
  324. Lantastic is a trademark of Artisoft corporation.
  325.  
  326. IPX is a product of Novell inc.
  327.  
  328. PGP (Pretty Good Privacy) is copyrighted by Phillip Zimmermann.
  329.   
  330.  
  331. =======
  332.  
  333. I would like to thank the following persons in no particular order for
  334. making helpfull suggestions, pointing out bugs and spending time and
  335. effort in testing:
  336.  
  337. Evert Bruinsma.
  338.  
  339. =====
  340.  
  341. Michiel van der Vlist (2:500/9.5)
  342. Dec 1993
  343.  
  344.  
  345.  
  346.  
  347.