APPENDIX F

CRYPTANALYSIS SUPPORT PROGRAM




Program Support
F-1.
This program supports the development of FM 34-40-2, Basic Cryptanalysis. It gives
the capability to encipher and decipher messages in monoalphabetic and
polyalphabetic substitution systems, produce a variety of statistical data about the
encrypted messages, and print the results or save them to disk. Because of its limited
purpose, the program does not support on-screen analysis. The printed results can be
used off-line to aid in analysis, however. The program should be particularly useful in
preparing examples and exercises for training cryptanalytic techniques.

On-screen Analysis
F-2.

The logical structure is present in the program to support on-screen analysis, if
desired. The coding that now sends results to disk or printer can be modified to display
on screen as well. Lines 6060 through 6780 provide the basis for this. This code together
with the alphabet entry subroutines in lines 3920 through 5760 can be used to enter
partial trial recoveries and see the results for both monoalphabetic and polyalphabetic
systems.

Program Format
F-3.
The listing has been specially formatted to make it easy to follow the program logic.
Each statement in multiple statement numbered lines has been printed on a separate
line with each follow-on statement indicated by the statement separator (colon) at the
beginning of the line. FOR-NEXT commands have been indented to show the level
and structure of each. Similarly, the parts of IF...THEN...ELSE statements have been
printed on separate lines and then indented to show their structure clearly. If the
program is typed in by hand, the statements in a single numbered line should be
entered continuously, not on separate lines in most versions of BASIC. Indentation of
FOR-NEXT structures can be preserved, if desired, but not for IF...THEN...ELSE
statements.



F-0
F-1
F-2
F-3
F-4
F-5
F-6
F-7
F-8
F-9
F-10
F-11
F-12
F-13
F-14
F-15
F-16
F-17