Notes to the K4 Simple Substitution Enciphering Program: Welcome to the K4 enciphering program. This program was written by Archie W. Bullington in October 2001. I based it upon a program written by Mike Barlow. Mr. Russell Atkinson kindly assisted me with some of the module programming. After downloading this program to your hard drive or diskette, double-click on the TV icon labeled SIMSUBK4 to begin the program. If you wish to print the final screen showing your work, please have your printer turned on. The first screen shows the introduction to the program and the credits. The next 3 screens show the rules as given by the ACA for simple substitution ciphers submitted to The Cryptogram. These rules are found in The ACA and You. After the rules, an example is given for this type of key. One keyword is used for the plain alphabet and the other keyword is used for the cipher alphabet with the two alphabets being different from each other. You are then asked to enter your first keyword at the prompt. You will then be asked for the second keyword. You can enter them in either lowercase or uppercase letters. Lowercase letters are automatically converted to uppercase. If your keywords have repeated letters, the program will automatically eliminate all duplicate letters. It adds the plain straight alphabet to the keywords and eliminates any duplicated letters as well. The result is two keyed 26-letter alphabets. After entering your keywords, you will be asked to shift the plain alphabet from 1 to 25 spaces. Any number greater than 25 will be ignored. To finish with the plain alphabet shift-process, press '0' and then ENTER. If any plain alphabet letter equals itself in the cipher alphabet, the program will not allow 0 to let you finish. After finishing with the plain alphabet, you will be asked to do the same for the cipher alphabet. Before finishing, the 2 alphabets must not have a plain letter equaling itself in the cipher alphabet. You will then be asked to enter the message that you want to encipher. This can be done in either uppercase or lowercase letters. The program automatically converts all lowercase letters to uppercase letters. You may use normal punctuation except the double quotation mark. To imitate this mark, use the apostrophe twice. For example, ''. After entering your message, you will be asked to enter a crib or tip to aid in solving the cipher problem. If you wish to include one, type it in at the prompt. It will automatically be enciphered in a Caesar cipher using a shift of 6. If you do not wish to include one, simply press the space bar once and then press the ENTER key. The final screen shows the keyword, the alphabets, the plain message, the enciphered message, the tip (if any0 and its enciphered equivalent (if any). To print this screen, press SHIFT and the PRINT SCREEN keys simultaneously. This should work, as this is a DOS program. PROGRAMMING NOTES: This program can be run within the Qbasic environment. The string, PAK$, stands for "Press Any Key". The UCASE$ function is used to convert lowercase letters to uppercase. It ignores spaces and punctuation marks. The algorithm that I used to eliminate duplicate letters was copied from a textbook on Qbasic. This works great as Qbasic has no functions to accomplish this. PowerBasic 3.5 has functions that delete repeated letters, but doesn't work within Qbasic. The program continues to loop until the alphabet is exactly 26 letters long. The shift algorithm gave me trouble in my original Pascal version. Mr. Atkinson assisted me in getting it to work properly. A check procedure is included along with the shift module. It checks the alphabets for matches. As long as a letter equals itself, it will not allow you to leave the shift process. The enciphering procedure examines the plain text message and locates each letter, space, or punctuation mark in the plain message, looks for it in the plain alphabet string, notes its position, and saves the corresponding letter, space, or punctuation mark in the cipher alphabet. The result is the enciphered message. I used the "LOCATE" command in the wrap-up module to format the output in a neat manner. If you have, any questions about any part of this, please e-mail me at archieb@nctc.com or archieb42164@yahoo.com.