RNDMGD.DO, documentation for true-random character generator RNDMGN.BA by James Main Kenney, 1995 RNDMGN.BA uses the human randomness of key presses to generate a file of truly random characters in any selected range between ASC(1) and ASC(255). Such a file may be useful in cryptography or for games. RNDMGN.BA can also be used to easily produce a file of any desired length containing either pseudo-random characters or repetitions of any single character, or a file containing one character of every ASCII value in a selected range; any of which may be useful in testing cipher programs. At the following prompts: "Random output file?" -- Enter the name of a file to receive the generated characters. An existing file will be appended to with no damage to previous contents. "Size (optional)?" -- Enter the desired file length to automatically fill the file to a preset size (best mode for pseudo-random or single characters). Press only ENTER to manually fill the file (best mode for true-random characters). "Optional source file?" (after a display of all filenames) -- Enter the name of any text file, random or otherwise, from which to draw characters whose ASCII values will be used to increase the randomness of the output characters (especially valuable when automatic mode is used; a pseudo-random file can be reprocessed any number of times to destroy the underlying mathematical pattern present in a pseudo-random sequence). If the source file is empty, the message "Empty!" will appear and the "Optional Source file?" prompt will be repeated; enter a different filename or press only ENTER to skip. When the end of the source file is reached, it will be automatically closed and reopened, allowing any amount of reuse required. The source file will not be altered. "Skip 0 source file chrs?" (appears only if a source file was named) -- Enter a number to determine the starting position in the source file (may be useful to avoid repetition). The skipped characters will be printed on the screen. Press only ENTER to start with the first character. "Skip 0 pseudorandom numbers?" (If a number >0 was entered at the previous prompt, that number will replace 0 as the default value.) -- Enter the number of pseudo-random numbers to be pre-drawn prior to generating characters; press only ENTER for the same number as the number of characters skipped in the source file. (This is another useful way to avoid repetition, since the pseudo-random generator cannot be "seeded" to produce a different sequence.) As the pseudo-random numbers are drawn, a countdown will appear on the screen. "Lo, Hi chrs ( ,~)?" -- Type the first and last characters of the font (character set) to be used (in ASCII sequence) separated by commas, then press ENTER, or enter only the first character and then, at the "??" prompt, enter the last character. The default characters are the space (ASCII 32) and the tilde (ASCII 126), covering the printable 7-bit (original) ASCII range. Entering the same character in both positions will produce a file with only repetitions of that character, useful as a plaintext file when testing the randomness of ciphertext. "Lo, Hi codes ( 32 , 126 )?" (If the default characters of the previous prompt were changed, the default codes will correspond to the new characters.) -- Enter the ASCII values of the first and last characters if the defaults are not correct; this may be useful if either character does not appear on the keyboard. Note that no characters can be stored corresponding to the null (0), the EOF marker (26), or the back space (127); these may be included in the selected range, however, and will simply be skipped without affecting the character count. After the last of the previous entries, the message "Font:" will appear, followed by a display of all the characters in the range selected. "(F)ile font?" -- Press either key F or key Y (upper or lower case) to print the font to the output file in place of random (etc.) characters, followed by a return to Menu (this may be useful in testing cipher programs). To bypass, press only ENTER or any key other than F or Y. "Tap keys at random; (ESC) for MENU" -- Press any key to start a reverse-video display of pseudo-random characters. Press any key other than ESC (or SHIFT, etc.) to produce, in normal video, a true-random character to be sent to the output file, followed by a number giving the total count of such characters; this character will be formed from a combination of the ASCII value of the key struck, the ASCII value of the character drawn from the source file (if used), the pseudo-random number drawn at that moment, the seconds of clock time, and even the previous-cycle value. Note that there are two distinct types of "human randomness" involved: in choosing which key to strike, and in choosing the exact moment to strike it. The latter can break up both the mathematical pattern of the pseudo-random generator and the coherence of the source file, which can be ordinary text, although even a previously used random or pseudo-random file may give greater confidence. Obviously, care should be taken to avoid any regularity in the key presses, in either sense; the screen display may be useful in avoiding a regular tempo, but ignoring it could possibly be better (?). If a non-zero entry was made at the "Size (optional)? prompt, a different procedure may be followed: Characters will be sent to the output file automatically, and printed to the screen with their count numbers, as long as no key is pressed and the file size limit not reached; pressing a key inhibits sending a character to the file and prints a reverse-video character to the screen. After the size limit is reached, the previously discussed mode is restored and additional characters can be added to the file if desired. When the desired file size is reached, press ESC to return to Menu. The output file is opened to append, so that RNDMGN may be reentered and more characters added to the output file without destroying the previous contents (but the count will be of only the added characters!).