CFR2D4.DO by James Main Kenney 1997 Part 4 (of 5) documentation for encryption program CFRJMK version 2.0 (CFRT20.BA for the Tandy Radio Shack TRS-80 Model 100/102/200; CFRN20.BA for the NEC PC-8201A/8300; CFRJMK20.BAS for GW-BASIC/QBASIC, compiled as CFRJMK20.EXE for MS-DOS/Windows) Operating Instructions A (Beginning) It is important to note that most of the prompts must be answered in an identical manner when decrypting as they were when encrypting. Use the previous parts of this documentation as a guide to choosing the options. Either upper or lower case may be used for the prompted key presses. Numerical entries should be positive integers in the range of 0 to 32767. If the name of a non-existant input file is entered, or an essential (ciphertext) file is not named, the filename prompt will be repeated (with a beep). The program may be exited at any letter prompt by pressing the ESCape key; for CFRJMK20.BAS/.EXE, there is then a rerun prompt: press key R or key Y to restart or any other key to exit. Pressing ESC during encryption or decryption proper will end the run and allow a normal exit as though the input file was only of the length processed. At the first prompt, choose between encryption and decryption by pressing key E or key D, respectively. This choice sets the wording of the prompts for the input and output files. At the second prompt, enter the name of the optional plaintext file if encrypting, or the name of the mandatory ciphertext file if decrypting. Pressing only ENTER without typing a requested plaintext filename will later enable plaintext to be entered directly through the keyboard and encrypted a character at a time. The program-resident keytext will now be displayed above a prompt allowing its use as-is by pressing only ENTER, rejected by pressing key N, temporarily shortened by pressing key C, temporarily added to from a file by pressing key A, or temporarily substituted for from a file by pressing key S. For either of the last two choices, a prompt will appear for the name of the file containing the keytext to be added or substituted. If a filename is entered, the first 255 characters in the file (fewer if adding) are then read into the program as a single string and the new "resident keytext" will then be displayed above a repetition of the prompt allowing its acceptance, rejection, abridgement, augmentation, or replacement. If ENTER is pressed without typing a filename, the actual resident keytext is again displayed and the prompt repeated (starting over). If key C is pressed to cut the length of the resident keytext (actual or replacement), there will be a prompt for the new length: enter a positive integer or press only ENTER to leave the length unchanged. In either case, a new display and another repetition of the prompt will then follow, permitting extended manipulation (e.g., cutting followed by adding, which can be repeated indefinitly to add keytext from any number of files). To change the resident keytext or to prepare a file substitute, use the built-in true-random generator (accessible following the main keyfile name prompt) to append characters to an auxilliary file or to the ASCII source code (.DO or .BAS) file, moving them to line 42 (after 42 G="). IMPORTANT: these random characters may contain double quotation marks (") which must be deleted (but do not delete the original one after the equal sign). Note that the resident keytext in CFRJMK20.EXE may be directly altered, but its length must not be changed; for a different length, edit CFRJMK20.BAS and recompile. The Tandy and NEC versions run noticably slower using a larger resident keytext, which creates a correspondingly larger "keystring" if the resident keytext is used. If it is not used, by pressing key N or deleting line 42, then the keystring is formed from only the keyboard-entered keytext ("passwords") and will have that length. The request for the name of the optional (main) keytext file may be rejected by pressing only ENTER. If a keyfile is named, the following three prompts will then appear: * The keyfile will be read starting with the character following the number of characters specified by a positive integer entered at the prompt "Skip 0 chrs?"; press only ENTER to start with the first character in the file. Starting past the first character allows previously used keytext to be skipped for "one-time" encryption, or provides added security if the keyfile should be compromised by unauthorized access to the computer. * At the prompt "(F)or fontstring only?", press key F or key Y to use the keyfile only during the initial fontstring permutations, or only ENTER to also use it during encryption or decryption proper for best security. * At the prompt "Add 0 random chrs?", press only ENTER to use the (existing) keyfile as is, or enter a positive integer to create a random keyfile of that length or to append that number of random characters to an existing file. The prompt "Tap keys randomly; (ESC) ends" will then appear: tap any key to start a flow of pseudo-random characters. Tap a key at any time to send to the file a character formed by the same pseudo-random process but modified by the ASCII value of the pressed key. This character is displayed in reverse-video followed by a count of the characters filed. There are two random elements involved: the randomness of the time the key is pressed, which breaks up the underlying mathematical pattern of the pseudo-random number generator, and the randomness of the key choice; both should be irregular. Pressing the ESCape key will stop the process prior to reaching the entered number. The keyfile is opened for input at this point, so that an error in entering the filename (without adding new random keytext) will only now cause a repeat of the keyfile name prompt. If a non-zero number was entered at the "skip" prompt, there will now be a delay for the skip to be made, preceded by "Wait". The next prompt is for the name of the mandatory ciphertext file if encrypting, or the name of the optional plaintext file if decrypting; pressing only ENTER in the latter case will result in the plaintext appearing only on the screen as it is being decrypted, with no permanent record. For CFRJMK20.EXE only, with ciphertext files of 8 KB or smaller, the same name may be used for both infile and outfile, allowing "in-place" encryption with automatic destruction of the input by the output. This can be used in place of the overwrite and renaming options at the end. At the prompt, "(N)o autokey?", press key N to reject the use of the previously processed plaintext as added keytext if degradation of the ciphertext is anticipated, otherwise press only ENTER to accept the autokey for added security. At the prompt "(U)se pseudorandom generator?", press key U or key Y to use it, or only ENTER to reject. The next prompt, for "security level", sets the upper limit for the random number of cycles used to generate the working key for each plaintext character; enter a positive integer or press only ENTER to accept the default of 1 (adequate for "one-time" encryption). If a plaintext input file was named, the prompt "Display plaintext or: (B)lank screen (O)ut-in (K)ey (T)ime-key?" allows the (default) plaintext display to be replaced by a blank screen or by scatter diagrams (pixel plots) of output versus input (shifted), the working key, or the key versus time (see CFR2D3.DO for what to look for). For CFRJMK20.BAS/.EXE, there is an additional choice: "(S)trings", which allows the keystring and fontstring to be observed as they are altered during encryption or decryption. Press one of the parenthetically indicated keys or press only ENTER for the default plaintext display. (concluded in CFR2D5.DO)